jquery - Chrome extension add button to site -
i'm trying simplest thing ever , won't work. i'm literally trying add button every tweet, now, later capture , send offiste when clicked. have , won't work, it's i'm failing hello world.
manifest.json
{ "name": "tweep", "author": "fisher", "manifest_version": 2, "version": "1", "icons": { "16": "logo.png", "48": "logo.png", "128": "logo.png" }, "content_scripts": [ { "run_at": "document_end", "js": ["jquery.js", "addbutton.js"], "matches": ["https://twitter.com/*"] } ] }
addbutton.js
$( ".profiletweet-actionlist u-cf js-actions" ).append( "<p>test</p>" );
here's funny part. chrome output 2 errors when load extension
uncaught typeerror: document.getelementsbyclassname(...)append... uncaught referenceerror: $ not defined
it throw these errors pretty whatever write, however, if add alert("boom");
addbutton.js, execute.
make sure include jquery library. not loaded.
in case do, make sure include before use of jquery object.
it might using other libraries interfere, can check , edit question please?
Comments
Post a Comment