Fails to get the visit button: Cannot read properties of null (reading 'cloneNode')
See original GitHub issueDescribe the bug Just stopped working out of the blue, I’d been using it fine for the past couple years; I’m not exactly sure if it stopped working today or during the week. I’ve tried in different computers and browsers, using both Firefox and Chrome. I typically just use Firefox, but to make sure it wasn’t down to the browser I also tested it on Chrome, which gave a bit more info on the console per the screenshot:
Cannot read properties of null (reading 'cloneNode') and it points to content-script.js, line 134
Seems there is probably a new element or naming convention that doesn’t fall into the current 3 switch cases.
To Reproduce Search anything on Google Images.
Expected behavior I would expect it to show the usual “View Image” button.
Screenshots


System Information
- Browser: Firefox v100.0.2
- Browser: Chrome v102.0.5005.63
- Version: 3.6.2
Issue Analytics
- State:
- Created a year ago
- Reactions:6
- Comments:40 (13 by maintainers)

Top Related StackOverflow Question
I looked into this closer and it’s just that the Visit button has a new class name; this is the PR to fix the issue: https://github.com/bijij/ViewImage/pull/243
In the meantime, I also updated the script to be used with extensions such as GreaseMonkey, TamperMonkey, etc. You can grab the script here: https://gist.github.com/ner00/ec9ae47e202b8e99f19be44a5af6baf3
NOTE: The script linked above will not work if the extension is running at the same time. While the extension isn’t updated, you can disable it and use the script instead.
For those who might not know how to install custom scripts to run in your browser, like an extension, follow this:
Make sure to disable or uninstall the View Image extension in your browser (go to settings, find the section with extensions, and disable or uninstall it).
about:addonschrome://extensions/Install an extension that allows to add custom scripts, most popular are Tampermonkey and Greasemonkey (choose one):
Install the script mentioned, which can be installed directly by clicking here: https://gist.github.com/ner00/ec9ae47e202b8e99f19be44a5af6baf3/raw/viewimage.user.js
Should be fixed up now for firefox, again chrome is pending review. hopefully doesn’t take too long.