Hi, I am using MW 1.34.2 and have been having some issues with custom Javascript code.
In one os my scripts I need to run some code after the page is loaded, so I use document.addEventListener("DOMContentLoaded",myFunction, false);
. However, the DOMContentLoaded
event never gets triggered. Using Chrome Dev Tools to "watch" document.readyState
, I noticed it never leaves the 'loading' stage.
This property can be 'loading', 'interactive' or 'complete' and (I recently learned that) once it gets to 'complete' the DOMContentLoaded
is triggered. The "loading" wheel on my Chrome tab stops spinning and all content on the page seems to be in place, but document.readyState
is still stuck in 'loading'. Something is preventing completion of the loading process, thus causing my scripts to never run.
(Actually, sometimes document.readyState
eventually turns to 'complete', but it takes several minutes, so it might be something timming out, instead of failing... not sure).
I have tried changing my skin and disabling all my custom scripts, to no avail.
There are some errors / warnings on my console after loading any page on the wiki. From what I was able to figure out (googling) they do not seem to be the issue, but still, here is the output:
P%C3%A1gina_principal:1 Unchecked runtime.lastError: The message port closed before a response was received.
P%C3%A1gina_principal:1 Unchecked runtime.lastError: The message port closed before a response was received.
P%C3%A1gina_principal:1 Unchecked runtime.lastError: The message port closed before a response was received.
load.php?lang=pt-br&…s&version=1j8oy:144 JQMIGRATE: Migrate is installed with logging active, version 3.0.1
VM97:105 This page is using the deprecated ResourceLoader module "jquery.tabIndex".
P%C3%A1gina_principal:1 Mixed Content: The page at 'https://www.mydomain.com/wiki/P%C3%A1gina_principal' was loaded over HTTPS, but requested an insecure favicon 'http://www.mydomain.com/wiki/Favicon.ico'. This request has been blocked; the content must be served over HTTPS.
P%C3%A1gina_principal:1 The resource https://www.mydomain.com/w/logo_wiki.png?bda1e was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.
Any thoughts will be greatly appreciated.
Thanks in advance