chrome extension: how to send ‘keydown’ event to page’s input?

Your code is not working because jQuery’s keydown() method does not actually trigger a “real” keydown event. Instead, jQuery looks up the “bound” event handlers in jQuery.cache, and calls the corresponding functions. Since your content script’s jQuery object differs from the page’s jQuery object, invoking .keydown() doesn’t cause any action. In your case, I suggest … Read more

Chrome extension page action appearing outside of address bar

It appears like this is the result of a new update to Chrome, with the developers probably reasoning that most users would not know that they had extensions installed otherwise. Link to announcement: https://groups.google.com/a/chromium.org/forum/#!searchin/chromium-extensions/upcoming/chromium-extensions/7As9MKhav5E/dNiZDoSCCQAJ It doesn’t look like extension developers can do anything about this, but I really hope Google reverts this change.

Persistent background page on demand or an event page that doesn’t unload?

Background pages cannot be unloaded on demand, and Chrome decides Event page lifecycle for you (there is nothing you can do in onSuspend to prevent it). If your concern is timers, you could try my solution from this answer, which basically splits a timer into shorter timers for a “sparse” busy-wait. That’s enough to keep … Read more

about chrome.tabs.executeScript( id,details, callback)

The result of a script is the last expression being evaluated. So in your example you could use: chrome.tabs.executeScript( null, {code:”var x = 10; x”}, function(results){ console.log(results); } ); This will log [10] to the extension’s console. results is actually an array of values because if the page has more than one frame you can … Read more

tech