CSS filter for IE6 standard mode and quirk mode? - browser

Is there any CSS filter can be applied to detect IE6's standard mode and quirk mode?
The story is that a jQuery script is using $.support.boxModel to handle different rendering mode. But the CSS use the *width hack to define the dimension. But this hack can only filter whether the browser is IE but not the real rendering mode IE is on.

You can't do it in css, but you can include different stylesheets for different versions of IE using conditional comments.

Why would you need that? Usually you write a style sheet for one explicit HTML document or at least one specific site where you know whether that page/site is running in quirks or standards mode.
It's not like a page can unexpectedly change modes :-)
If you really need to support a mixture of pages with different modes you'll need to use two separate style sheets, one for each mode.

I ended up using js injection
if(!$.support.boxModel) $('body').addClass('nobox');
And then do the styling in CSS.

Related

Macros in MathJaX

I would like to add some macros in my MathJax configuration. Specifically I would like to add:
\arcsin and be displayed as {\rm arcsin}
\arccos and be displayed as {\rm arccos}
\arctan and be displayed as {\rm arctan}
\arccot and be displayed as {\rm arccot}
I have read the MathJaX documentation and although I think that I do the steps right, I end up with either the MathJaX not working properly or not loaded at all. By the way, why are these commands not supported at all? I think they should. Is there a specific reason?
How can I add these macros in my configuration?
MathJax 3 supports all the commands you mentioned (\arcsin, \arccos, \arctan and \arccot) so you don't have to create macros for them. For \arccot, the physics extension must be loaded.

Sahi: Cannot execute scripts recorded in a browser in multiple browsers

Our web application is designed such that the text transform is picked from CSS.
There are multiple links on a webpage; hence i will take example of a Next link.
When i hover the mouse over Next link in FF, it shows the below code:
_click(_link("Next"));
Similarly when i hover the mouse over the same link in Chrome, it shows the below code:
_click(_link("NEXT"));
When the script is recorded in FF and executed in chrome, it fails at the location because "Next" link is unavailable. This is one example of a link and there are multiple links and multiple pages. For this scenario, do i need to verify the text for each link or is there a universal way i.e. toLowercase method that can help me.
Thanks.
As Kshitij pointed out, you can get this working by using a regular expression as your accessor... but you might also check the Alternatives pulldown in the Controller. Perhaps there's an alternative accessor that is better suited for both browsers.
I think, the question should be how can Sahi identify the element with text by ignoring the case-sensitivity.
Any tool can only record the attributes which is available on the browser at that time.
You can use the following code to achieve the functionality:
_click(_link("/Next/i"));

HTML Purifier setup - having trouble allowing Rich Text, only need the security side

I'm trying to setup HTMLPurifier for my needs. I have it up and running but straight out of the box it strips all formatting. I tried delving through the documentation but that was an exercise in frustration. Is there an easy configuration option that only implements the security aspect of the program and allows through all the rich text styling, etc. I'm not exactly sure how the YUI RTE marks up its output for styling so simply going through and creating a whitelist might be quite time consuming and involve going through both the purifier documentation and the YUI documentation - all for a simple task. Anyone have any premade configurations for this sort of thing or at least a point in the right direction? Thanks.
By default HTML Purifier allows as much styling as possible that can be allowed securely. So you are probably seeing a different problem; my guess is magic quotes. You should var_dump the HTML right before it enters HTML Purifier and turn off magic quotes if there are extra backslashes.

Any browser plugins for customizing web pages intelligently?

I generally use firebug to remove unwanted divs and tags and resize stuff on the web-page .. frequently for gaming sites like chessbomb. But this is tedious, and every time tab reloads, i would have to do it all over again.
So is there any plugin which would remember the setting for particular site and apply it on the load itself. For starters i just need something to remove div tags based on names. If it can resize too then thats all the more useful.
Thanks.
You can use Adblock Plus with some CSS selector usage to do this. Look at the doc related to this here.
For example, you could probably use something like
domain.com##div.class
to hide those divs.
This is a use case for the greasemonkey firefox plugin. You'll need to know a little javascript, but if you're doing these sorts of things in Firebug, I would assume you won't find greasemonkey too dofficult.
Have a look at http://www.greasespot.net/ and http://userscripts.org/ and you may even find someone has already written the script you're after.
To quote wikipedia on Greasemonkey:
Greasemonkey is a Mozilla Firefox extension that allows users to install scripts that make on-the-fly changes to HTML web page content on the DOMContentLoaded event, which happens immediately after it is loaded in the browser (also known as augmented browsing).
As Greasemonkey scripts are persistent, the changes made to the web pages are executed every time the page is opened, making them effectively permanent for the user running the script.

How do you handle very old browsers on your site?

We have a non-profit web site that got about 5 million hits in May. Of those, about 5,700 were from IE 5.x or lower; about 4,000 were from folks with Netscape 4.x or lower. We know that the current site's layout works for newer browsers and we're testing it on IE6 as well (along with Chrome, Opera, Safari, and Firefox). How do you handle the folks with the older browsers? Because of jQuery libraries and such, the pages might not function correctly on those old browsers.
Is there an easy way to show a text-only version on browsers that can't handle the CSS and jQuery goodies? How do large sites handle this sort of thing? I've used the #embed to hide the stylesheet from Netscape 4.x, but not sure beyond that.
You should not keep the old browsers as your main priority - just keep the content readable on them, and maybe add a helpful banner that explains they are using an outdated browser.
However, you don't have to focus on getting the layout look 100% same on browsers that old, that's just waste of time. As long as the content is available and they can navigate the site, it should be fine.
Make sure that all content is accessible and readable from a browser like Lynx, and no content requires Javascript to read & access.
I would suggest designing for disability accessibility and seeing if that would produce those results as well - kill two birds with one arrow.
If you use tableless / css based design techniques then you can easily fall back to text only.
You could use conditional comments to only include css files in certain version of internet explorer.
You could use jquery version checking to only execute it on the versions you want to.
Something else I just thought is that you could show a message to older browsers like I have seen around the web urging the user to upgrade for compatibility and most importantly SECURITY. (I think twitter is doing this now).
And another thought - if you are going back to browsers that old you are probably going to have to worry about screen size as most sites as designed to fit 1024 x 768 minimum these days but at once point 800x600 was the entry level...
Here is what Big G has to say about it :)
http://googleenterprise.blogspot.com/2010/01/modern-browsers-for-modern-applications.html
They are going to stop supporting IE6...

Resources