Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can make cross domain calls from a content script if you put a url in the permissions part of your manifest...<br> <a href="http://code.google.com/chrome/extensions/xhr.html" rel="nofollow">http://code.google.com/chrome/extensions/xhr.html</a> </p> <p>What it seemed to be choking on was the callback that you put in the request url and thats not needed so I took it out.<br> Here's a working version of your code....<br> <strong>Manifest</strong> </p> <pre><code>{ "name": "dA Tooltip Thumbnail", "version": "1.0.0", "description": "What the name says.", "permissions": [ "http://backend.deviantart.com/*" ], "icons": { "48" : "sample-48.png", "128" : "sample-128.png" }, "content_scripts": [ { "matches": ["http://my.deviantart.com/messages/*"], "js" : ["jquery-1.7.1.min.js","contentscript.js"] } ] } </code></pre> <p><strong>ContentScript</strong> </p> <pre><code>$(".mcb-title a:first-child").each(function() { var b=$(this).attr("href"); null!=b.match(/https?:\/\/fav\.me\/.*|https?:\/\/.*\.deviantart\.com\/art.*/)&amp;&amp;"true"!=$(this).attr("da-message-preview-attached")&amp;&amp;$.getJSON("http://backend.deviantart.com/oembed?url="+encodeURIComponent(b),$.proxy(function(b) { $(this).addClass("da-message-preview").attr("rel",b.thumbnail_url).attr("da-message-preview-attached","true"); $(this).hover(function(a) { window.daMessagePreviewTitle=this.title; this.title=""; $("body").append('&lt;p id="da-message-preview"&gt;&lt;img src="'+this.rel+'"/&gt;&lt;/p&gt;'); $("#da-message-preview").css( {top:a.pageY-10+"px",left:a.pageX+30+"px",position:"absolute",border:"1px solid #666",background:"#EEE",padding:"5px",display:"none","-webkit-border-radius":"6px","-moz-border-radius":"6px","border-radius":"6px","-webkit-box-shadow":"0px 2px 8px #000","-moz-box-shadow":"0px 2px 8px #000","box-shadow":"0px 2px 8px #000","z-index":"123456"}).fadeIn("fast") },function() { $("#da-message-preview").remove() }); $(this).mousemove(function(a) { $("#da-message-preview").css("top",a.pageY-10+"px").css("left",a.pageX+30+"px") }) },this)) }); </code></pre> <p>The only error I noticed after the changes was it tries to get a url that gets a 404...<br> <a href="http://backend.deviantart.com/oembed?url=http%3A%2F%2Fnews.deviantart.com%2Farticle%2F143885%2F" rel="nofollow">http://backend.deviantart.com/oembed?url=http%3A%2F%2Fnews.deviantart.com%2Farticle%2F143885%2F</a><br> ...small error, Ill leave it up to you to get rid of that one ;).<br> OH, and I took out the timer stuff, is that really needed? Wont you be going to a different url when you click on a gallery?...because if you do then the content script will get reinjected (you may need to add more matches for that tho, didnt really look).</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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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