I've got a page which uses Flash with animations (These are not crucial but additional).
Everything works fine, if I'm not using Opera with activated Turbo. Then the Flash Movie is shown as a big ugly arrow in a circle the size of the flash movie which is intended to act as a play button for the flash.
I'm using SWFobject, so I easily could turn of the animation if I knew if Opera's turbo mechanism is used, but how do I do this in JavaScript (or maybe CSS if this goes)
How to reproduce?
Surf this page with Opera (or any other page which uses flash)
/
Without Opera Turbo you see a flash animation and flash version information
With Opera Turbo you see two white arrows in gray circles
edit 1 I'm quite sure now, that there is not a pure JS solution and not a PHP solution. The best guess is a bined AS/JS solution.
I've got a page which uses Flash with animations (These are not crucial but additional).
Everything works fine, if I'm not using Opera with activated Turbo. Then the Flash Movie is shown as a big ugly arrow in a circle the size of the flash movie which is intended to act as a play button for the flash.
I'm using SWFobject, so I easily could turn of the animation if I knew if Opera's turbo mechanism is used, but how do I do this in JavaScript (or maybe CSS if this goes)
How to reproduce?
Surf this page with Opera (or any other page which uses flash)
http://www.adobe./software/flash/about/
Without Opera Turbo you see a flash animation and flash version information
With Opera Turbo you see two white arrows in gray circles
edit 1 I'm quite sure now, that there is not a pure JS solution and not a PHP solution. The best guess is a bined AS/JS solution.
Share Improve this question edited Apr 10, 2013 at 13:07 yunzen asked Jan 11, 2012 at 9:42 yunzenyunzen 33.4k13 gold badges78 silver badges113 bronze badges 4- are you still able to circumvent plugin-on-demand in Opera ? – c69 Commented Jan 11, 2012 at 9:49
- @c69 I don't know anything about that. And I don't think this is the problem. I just switch on Turbo and there you go. Flash is installed and if you klick on the play button, flash starts to play. – yunzen Commented Jan 11, 2012 at 10:02
- Sorry for of topic, but what is required to add bountys to a question? I've read the faq but cant seem to find it. – Johan Commented Jan 19, 2012 at 22:15
- @Johan you need to wait 2 days after the question was asked. Then you can add bounty – yunzen Commented Jan 20, 2012 at 8:05
3 Answers
Reset to default 5Client side detection: There is no way to access that through javascript. Client side detection for opera turbo is not possible currently, maybe it will be supported in the future but who knows?
Server side detection: When opera turbo is enabled all requests from client are done to opera servers, the opera servers are going to access your application (do pressions) and forward the processed content to the final client (user's puter).
With that in mind, let's do some network sniffing and see where are your connection going:
~$ nslookup opera10beta-turbo.opera-mini
>Server: 189.40.226.80
>Address: 189.40.226.80#53
>Non-authoritative answer:
>opera10beta-turbo.opera-mini canonical name = global-turbo-1.opera-mini.
>Name: global-turbo-1.opera-mini
>Address: 141.0.11.252
~$ nslookup 64.255.180.252
>Server: 192.168.1.254
>Address: 192.168.1.254#53
>Non-authoritative answer:
>252.180.255.64.in-addr.arpa canonical name = 252.0-24.180.255.64.in-addr.arpa.
>252.0-24.180.255.64.in-addr.arpa name = global-turbo-1-lvs-usa.opera-mini.
As you can see the name and canonical name from opera servers can be used to detect if you application is being accessed through opera servers intermediation. I think server side coding could handle that (not sure what language are you using on your server).
It's good to remember that Opera Turbo will not intermediate your requests if you're accessing something in your local server.
Hope it helps.
You can try to check if the flash object is loaded with some javascript. This code works on my puter with Opera 11:
<html>
<head>
<script language=JavaScript>
function isFlashBlocked(){
var blocked;
try {
// Can test this on any flash object on the page
window.document.myFlash.SetVariable("dummy", "dummy");
// Flash not blocked
blocked = false;
}
catch(err) {
// Flash blocked
blocked = true;
}
return blocked;
}
function removeBlockedFlash() {
if (isFlashBlocked()) {
// Hide all flash objects
window.document.myFlash.setAttribute("style", "display: none");
// ...
// Display replacement content
window.document.myImage.setAttribute("style", "display: inline");
// ...
}
}
</script>
</head>
<body onload="removeBlockedFlash()">
<object type="application/x-shockwave-flash" data="HelloWorld.swf"
width="100" height="100" id="myFlash">
</object>
<img src="image.jpg" style="display: none" id="myImage" />
</body>
</html>
If you detect that flash is blocked, you hide every flash object and display what you want.
Edit: This code doesn't work with Firefox, you probably need to detect the browser before using this function.
I believe that the answer to the speed issue is that the Flash content is not downloaded initially. You have to manually click on the icon to download it. Same for animated GIFs. This is part of the strategy to boost the speed. (cf., this Opera Desktop Team post.)
Which is why you want to know how to check for Opera Turbo, and not just Opera. From my local tests, I cannot tell the difference using PHP's _SERVER["HTTP_USER_AGENT"] variable. I think this is similar to what Opera lists as the user agent string, as shown here and here.
It seems that, rather notifying the website of the browser condition, Opera silently manages the request results differently.