|Jan 5, 2013, 07:35 PM||#1|
HTML5 flash replacement trick
While some websites (such as Youtube) have dedicated HTML5 versions, most other websites are still using Flash only. Interestingly, if you browse these sites on a mobile device then you'll find that they have actually been adapted to run without Flash. The premise is, using a special filter for GlimmerBlocker, we can have a system-wide setting in place which will spoof the user agent of an iPad to coax these websites into displaying Flash-free HTML5 goodness. Why are we spoofing an iPad? Well because it has a resolution similar to that of our PPC machines - the result is that we get a cleaner layout, but one which was designed for a bigger screen as opposed to a tiny mobile.
You will need GlimmerBlocker installed and running.
In the filters tab, add a new filter to store the rule in.
Add a new rule and leave everything as-is except Action, which needs to be changed to Modify Request. If you only want the to view certain sites then you can add them to the Host box - you will need to duplicate the rule for each site.
On the Request tab, copy and paste the following code:
var ua = gb.request.headers["User-Agent"] ua = ua ? ua.toString() : "none"; //if (ua.match(/Safari/)) // Uncomment this line if you only want a single browser to display in mobile mode gb.request.headers["User-Agent"] = ["Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10"];
You should be all good to go!
Quite a few browsers have a user agent changer built in, but I use Stainless which does not - hence why I created this.
Last edited by Wildy; Jan 6, 2013 at 03:05 AM.
|Jan 5, 2013, 09:00 PM||#2|
Excellent work! This is indeed a very cool and useful trick. I was experimenting with this myself, and the problem I was having was that I wanted to be able to enable UA spoofing only on one browser. I see that in your filter you can choose to do that when the user agent of the targeted browser matches a precise string. This is a very elegant solution. I can see only two problems with that:
1) it seems that GlimmerBlocker won't let you alter rules in a subscribed filter, so the user will have to copy and paste the single rule in your filter in a personal one, and then uncomment the required instruction.
2) every time the targeted browser is updated its user agent is changed, so it is necessary to manually edit the rule.
Other than that your filter works fine. I prefer to enable UA spoofing only on selected sites (that's because on most sites I already get html5 video through ClickToPlugin in Safari/Webkit) but it's only a matter of duplicating the rule in the filter and altering the targeted URL, and that's very easy and fast to do.
If you don't mind I would like to put a link to this thread here as a reference.
eMac 1.25 GHz, 2GB ram, Leopard & Ubuntu 12.04 + XFCE.
C2D MBP 2,66 GHz, Mavericks
Last edited by B-G; Jan 5, 2013 at 09:08 PM.
|Jan 6, 2013, 02:08 AM||#3|
Ah, that's where that thread went! I was actually looking for that so I could post this there, rather than start a new thread. But by all means, feel free.
I didn't realize you can't change the rules of subscribed filters - I shall update the instructions. To make things easier, I could use a regex to strip out the browser name from the UA string instead of requiring a complete one - this should work fine for browser updates too.
EDIT: Updated to reflect changes.
Last edited by Wildy; Jan 6, 2013 at 03:03 AM.
|Jan 6, 2013, 07:54 PM||#6|
Thanks to the OP for your good work.
This reminds me of a work-around either on MR or somewhere else, that entailed tricking Web sites into treating your PowerPC in the way they would an iOS device. As I recall, I think Fluid was involved.
Anyway, this is just another reason to enjoy working with PowerPCs. Stuff like this comes from years of needing to adjust to technologies that have sadly left behind some very good machines.
Etcha-Sketch, Classic Red; Kenner Easy-Show Projector, First Gen.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|HTML5 help||Serban||Web Design and Development||6||Jul 26, 2013 11:16 AM|
|HTML5 in YouTube||Peter Franks||Mac Basics and Help||1||May 22, 2013 11:59 AM|
|Way to view flash video's in HTML5?||TweakOnline||OS X||8||Jan 17, 2013 05:26 AM|
|[rMBP] Online video with flash/html5 not scaling well||Eduardboon||MacBook Pro||0||Jul 21, 2012 07:46 AM|
|Flash to HTML5||eyoungren||PowerPC Macs||0||Jul 1, 2012 05:00 PM|
All times are GMT -5. The time now is 10:21 PM.