Page 1 of 1

ReferenceError: adblock_detected is not defined

Posted: Mon Jun 22, 2015 4:40 pm
by DanyR
Hi,

when visiting http://www.naruget.net and trying to watch either episode, all I see is a black box instead of a video player. In the FireFox (V38.0.5) console i see the following entry:
ReferenceError: adblock_detected is not defined flownew_googplayer.php:60:47
referencing the 3rd line of this code block:

Code: Select all

   if(FlashDetect.installed){
      $f("flowplayer", {src:         "http://www.animeget.eu/cdn/flowplayer.commercial-3.2.7.1.swf", 
                        wmode:       'opaque', allowfullscreen:adblock_detected?'false':'true'}, 
                       {canvas:      {backgroundColor: 'transparent', backgroundGradient: 'none'},
                        showErrors:  false, 
                        onError:     function(errorCode) { if(errorCode == 303) $f().play(1); },
                        contextMenu: ["Videofun"], 
                        key:         "#$dd47bb6156e649699a5", 
						// custom play button
						play: {
I have also AdBlockPlus (ABP) installed (V2.6.9.1), but only after disabling NoScript (V2.6.9.27) completely lets me see the player.
ABP disabling or removal does not work and neither does setting NoScript to allow all scripts for every site. It seems to be something very deep down inside...

I'm using a new FF profile without NoScript for now to watch Naruto. Just wanted to let you guys know, so that you might improve your useful add-on even further ;)

Cheers,
Dany

Re: ReferenceError: adblock_detected is not defined

Posted: Mon Jun 22, 2015 6:04 pm
by barbaz
Well, it is possible to work around the problem in this one case with the information you've given, but it would be helpful to know the root cause in case other sites are likewise affected.

Please check the Browser Console (Ctrl-Shift-J) when it fails and post here any NoScript related messages (will probably start with either "[NoScript" or "[ABE]"; if you don't know what's related, turn off CSS warnings and post everything else you see).

Re: ReferenceError: adblock_detected is not defined

Posted: Mon Jun 22, 2015 6:22 pm
by DanyR
Thanks for the help.

Now I'm beginning to see the problem. Looks like they are using bad extensions with wrong headers inside.

This is, what I get:

Code: Select all

[NoScript] Blocking cross-site Javascript served from http://www.animeget.eu/cdn/fun3.jsx with wrong type info application/octet-stream and included by http://online.narutoget.com/s/flownew_googplayer.php?flowid=dd47bb6156e649699a5&to=1002kEhprnVM&id=112100296851571938885/Nship410ut$6143487520688443954
[NoScript] Blocking cross-site Javascript served from http://www.animeget.eu/cdn/fun3.jsx with wrong type info application/octet-stream and included by http://online.narutoget.com/s/flownew_googplayer.php?flowid=dd47bb6156e649699a5&to=1002kEhprnVM&id=112100296851571938885/Nship410ut$6143487520688443954
ReferenceError: adblock_detected is not defined flownew_googplayer.php:60:47

Re: ReferenceError: adblock_detected is not defined

Posted: Mon Jun 22, 2015 6:25 pm
by barbaz
try:
about:config > add the following to noscript.inclusionTypeChecking.exceptions

Code: Select all

.animeget.eu/*.jsx
(rant: Why does "everyone" want to serve JavaScript files with .jsx extension, with the wrong content-type? Sure, .jsx is indeed a valid extension for JavaScript - it's an Adobe variant - but come on, at least serve it with type text/javascript or application/javascript...)

Re: ReferenceError: adblock_detected is not defined

Posted: Mon Jun 22, 2015 6:35 pm
by DanyR
Hey, thank you very much, works like a charm :D

After investigating the used code a bit further, I saw a fall-back when flash is not installed to use a video tag instead. Why don't they swap to HTML5 for good? :?

And you are completely right with your "rant".

Re: ReferenceError: adblock_detected is not defined

Posted: Mon Jun 22, 2015 6:39 pm
by barbaz
DanyR wrote:Hey, thank you very much, works like a charm :D
np Image
DanyR wrote:Why don't they swap to HTML5 for good? :?
I'd guess something like, because not all browser support HTML5 video equally well - and they might be trying to still support, say, IE 8 or some REALLY old Firefox which have zero support for HTML5 video and they're being smart about how they do it in that they're not using UA sniffing..

Re: ReferenceError: adblock_detected is not defined

Posted: Mon Jun 22, 2015 6:46 pm
by DanyR
Hehe, very smart indeed! :lol:

Re: ReferenceError: adblock_detected is not defined

Posted: Tue Jun 23, 2015 3:16 am
by Thrawn
barbaz wrote: (rant: Why does "everyone" want to serve JavaScript files with .jsx extension, with the wrong content-type? Sure, .jsx is indeed a valid extension for JavaScript - it's an Adobe variant - but come on, at least serve it with type text/javascript or application/javascript...)
Perhaps it isn't in the standard (eg Apache) mimetype lists?

Re: ReferenceError: adblock_detected is not defined

Posted: Tue Jun 23, 2015 4:22 am
by barbaz
Thrawn wrote:Perhaps it isn't in the standard (eg Apache) mimetype lists?
Yeah, seems not (apparently, my server wants to serve .jsx with content-type "text/plain" if I don't go in and add .jsx extension to /etc/mime.types as javascript).