Chrome extension: How to manipulate inner Gmail DOM with jQuery? -
whilst no problem manipulate inner gmail content css content script, fail jquery , custom js content script.
i want use jquery manipulate inner gmail dom.
manifest.json
"content_scripts": [ { "matches": ["*://*.mail.google.com/*"], "js": ["jquery.js", "default.js"] } ],
default.js
$(document).ready(function() { $("div.gk").css("color", "red"); });
however, respective div.gk
element not reflect css changes:
any ideas why not work?
the domready event fires long before target element created. when go mail.google.com you'll notice loading bar - before appears event fired.
i'm not sure if gmail has custom events more reliable, otherwise i'd suggest using
jquery(window).load(function(){ jquery("div.gk").css("color", "red"); });
if feel dissecting events in more detail suggest reading on , using chrome developer tools, focus on timeline tab.
Comments
Post a Comment