Opera: .js file does not load

I have a page that calls a script in the header, for example:

<script type="text/javascript" src="http://www.discoverfire.net/analytics/l/a.js"></script> 

(Note that you will not be able to download this script since it is DNSd locally as an intermediate domain)

Very simple.

Firefox, IE, Chrome have no problems with this basic, square function.

Opera, however, refuses to load the script. Any variables or functions in it are "undefined", and in dragonfly the script tag is displayed in the DOM, but the "No script" files are displayed on the "Script" tab.

I go to Google and find random pages, their external .js files seem very good.

Any idea why Opera hates me? Is there a security / javascript issue that I am missing?

A few things that can make a difference, but really shouldn't matter:

  • The script is in a different domain than the page.
  • The script is only available on my local network. The DNS'd domain is locally set, from outside the network it points somewhere else. Does Opera have an option to secretly use an external DNS server?
  • The script works in any other browser.
  • The problem is not the content of the script. I reduced it to one line with a warning, and it just won’t work in Opera.

Update:

OK, the problem is how Opera handles the domain.

I moved the script to several other domains and it works fine. I moved it to several paths in the local DNS'd domain, and it will not work anywhere in this domain.

This makes me think that the problem is that Opera cannot or will not load a script from this domain for any reason.

Oddly enough, there are no problems loading pages and other resources from the domain, the problem is only in .js files.

The domain is registered but parked. We are DNS'd locally, so we can use it for setup / testing, and it may be somehow related to Opera with JS security.

I could be wrong, although I really have no idea. If anyone else has it, I'd love to hear it.

Update 2:

As for Dragonfly and console / developer tools, they don't say anything about the script at all. There are many Undefined variable errors for variables and functions that should be present in the script, but there are no errors besides this. Oddly enough, the script tag is displayed in DOMM, but if I click on the "Scripts" tab, it will say "No Scripts Found".

Update 3:

There is no blocked content, so we can at least exclude this setting.

+1
source share
8 answers

You might want to know if your ad blocker is blocking it. Your URL contains the text analytics, which may be part of the block this pattern. I know that some block Google analytics through Opera. An easy test for this might be trying to move your .js to a different path on the host.

+2
source

Have you checked the Opera error console? Tools> Advanced> Error Console It should provide information on why it is not loading or any other error.

+2
source

As Jacob suggested, you should check if it is locked. For this:

  • Right click on your page.
  • Select "Block Content ..." in the context menu
  • At the top of the screen, click the "Details ..."
  • You should see a URL blocked on the current page
+2
source

You should ask in the Opera forums. I had some problems with Opera in the past and they answered quickly.

+1
source

Is the host serving the correct mime type for the javascript file. This is not a well-known fact, but the type=text/javascript attribute is actually ignored by browsers because it assumes the server is indicating the correct type.

Also, the mime text/javascript type is actually erroneous when it comes to JavaScript, the actual mime JavaScript type is application/ecmascript (if I remember correctly, it could be application/javascript though). If you do not believe me, you should look here , where I had more information and was related to the videos of Douglas Crockford, where he discussed the type of mime.

+1
source

I had something similar recently - the opera simply did not run the script on an external server ... and would not download it and would not have it on localhost. It only ran when copying / pasting between script tags on an html page.

It turned out that the script was encoded in UTF-16, and this somehow confused the browser. When I converted it to UTF-8, everything went fine.

So, just in case, and if you still have this problem, check the encoding settings ...

+1
source

I had the same problem, having contacted downloading a script from localhost / development server to a page hosted on a public server, to no avail. The only way I controlled loading the script in Opera was to save a copy of the page in place on the same development server and use the tag to link to the source domain to get the .css and .js related files. This worked. Opera doesn't seem to like to mix public and local domains, but it handles localhost without any complaints.

+1
source

what you see is probably Opera’s security precaution against so-called “phish pharm” attacks: cross-network protection. You cannot mix content from a shared server and content from a local server.

Take a look at my answer here for a workaround:

Opera will not load some JavaScript files

+1
source

Source: https://habr.com/ru/post/1285874/


All Articles