Browser Extension Issue: Deferred exception: document.getElementById

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
User avatar
burger
Posts: 434
Joined: Mon May 11, 2020 4:32 pm

Browser Extension Issue: Deferred exception: document.getElementById

Post by burger »

When viewing an events page, e.g. the last hour of events, the page comes up blank in Firefox. The following errors show up in the console:

Code: Select all

jQuery.Deferred exception: document.getElementById(...) is null initPage@http://192.168.45.19/zm/cache/skins_classic_views_js_events-base-1677246574.js:244:12
@http://192.168.45.19/zm/cache/skins_classic_views_js_events-base-1677246574.js:391:3
e@http://192.168.45.19/zm/cache/skins_classic_js_jquery.min-base-1677246574.js:2:30038
l/</t<@http://192.168.45.19/zm/cache/skins_classic_js_jquery.min-base-1677246574.js:2:30340
 undefined


Uncaught TypeError: document.getElementById(...) is null
    initPage http://192.168.45.19/zm/cache/skins_classic_views_js_events-base-1677246574.js:244
    <anonymous> http://192.168.45.19/zm/cache/skins_classic_views_js_events-base-1677246574.js:391
    jQuery 2
The following error shows up in /var/log/zm/web_js.log:

Code: Select all

2024/09/23 10:48:58.397125 web_js[25762].ERR [] [TypeError%3A%20document.getElementById(...)%20is%20null] at zm/cache/skins_classic_views_js_events-bas>
Another error I came across, which I'm not able to replicate now is the following:
Source map error: TypeError: NetworkError when attempting to fetch resource. It was trying to access
moz-extension://a9d74191-69c6-49c5-a6d2-d566b7d10178/nscl/lib/browser-polyfill.js
I think it's when I try to click one of my noscript entries in the console debugger.

viewtopic.php?p=119841 Mentioned something about cookies and cache, so...

This points to it being a firefox issue. I tried ZM on another browser, and everything works ok, so it's
not a ZM issue. I tried firefox in a Private Window to see if it was the cookies or cache, and everything
works in the private mode.

Therefore I cleared the cookies and cache and... that did not resolve the error. But I am close, since
private mode works. I tried about:support in firefox, and clear startup cache...
That doesn't work. Restarting in troubleshoot mode, does work however.

So it turned out its one of the extensions. I disabled greasemonkey, and it works. It's because I have a
greasemonkey script that works on all pages. So I had to add an exclude in the script for ZM.
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
User avatar
iconnor
Posts: 3197
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Browser Extension Issue: Deferred exception: document.getElementById

Post by iconnor »

So... line 244 sets up the onclick handler for the back button. This error implies that the back button is not present in the page. I can see no reason for that to be the case. We could certainly add an if around this line to prevent the error....But I'd like to know why the backBtn doesn't exist. Can you do a view source and search for backBtn?
Post Reply