Posted on Leave a comment

Help with removing element chrome extension

Hey, so I am making an extension that removes an element but everytime I run it, I get the following error: TypeError: Cannot read properties of null (reading 'remove')

Could someone explain why?

Here is my manifest:

{ "manifest_version": 2, "name": "test", "description": "wip", "version": "1.0", "author": "me", "permissions": [ "contextMenus", "activeTab" ], "icons": { "128": "icon.png" }, "content_scripts": [ { "matches" : ["*", "*"], "js": [ "content_script.js" ] } ] } 

and here is content_script.js:

 try { document.getElementById("ID-WAS-HERE").remove(); } catch(error) {console.log(error)} 

submitted by /u/funnyfishwalter
[link] [comments]

Leave a Reply

Your email address will not be published.