Note that there are some explanatory texts on larger screens.

plurals
  1. POAuto-load bookmarklet when in webpage as a Google Chrome extension
    primarykey
    data
    text
    <p>Basically I made a bookmarklet, and I'd like it to run when a certain wildcarded URL is opened. For some reasons it won't simply run as javascript in a chrome extension, and I'm tired of trying.</p> <p>What <em>I think</em> could work is to make an extension that has a <code>content_script</code> for the specified page(s) (which allows a wildcard via <code>match</code>), and <em>somehow make it do the same thing that would be done if the user clicked the bookmarklet in the bookmarks bar</em>.</p> <p>However, I do not know how to make this.</p> <p>One thing to note is that <strong>I need it to access the page's global scope</strong>, i.e., break out of the extension sandbox (which is possible, and <a href="http://code.google.com/p/chromium/issues/detail?id=52946" rel="nofollow">has been confirmed</a> to be possible by design in the Chromium bug tracker).</p> <p><strong>So the question again is:</strong> how, from an <code>content_script</code>, do I "load the bookmarklet" (in other words, <strong>how to convert a bookmarklet to a Google Chrome extension</strong>). I have it in plain javascript too, if that could be of use.</p> <p><a href="http://jsfiddle.net/72ZtE/" rel="nofollow">This</a> is the bookmarklet, in case somebody wants to test with it. It's meant to be used at <a href="http://my.deviantart.com/messages/" rel="nofollow"><code>my.deviantart.com/messages/*</code></a> (but you need an account and messages in your inbox, to see the effect hover on top of a link to a "deviation", and it will show a tooltip with a thumbnail of it).</p> <p>(<strong>Edit:</strong> <a href="http://sta.sh/01vn95p8q0v2" rel="nofollow">Here's an extension attempt</a>, posted in an answer's comments)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload