patric99 / remote-torrent-adder

Automatically exported from code.google.com/p/remote-torrent-adder
0 stars 1 forks source link

3rd Party Re-initialization #53

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm adding support through another chrome extension for TVT, since they are 
using buttons/JS to obscure the actual torrent links, they can't really be 
picked up with Remote-Torrent-Adder in its current form.

It would be handy if I could use a post message to trigger a re-initialization 
on the remote-torrent-adder content script so that after I inject the 
compatible torrent link into the page then I can force remote-torrent-adder 
extension to recognize my newly injected link and handle it like normal 
(provided I have added the necessary link filter). 

Right now it works OK using the context menu.

Original issue reported on code.google.com by e...@ericdorsey.com on 29 Dec 2012 at 8:18

GoogleCodeExporter commented 9 years ago
if it's just buttons, i made a commit (r446983f95429) some time ago that gives 
at least partial button/form matching. you mention js though, so i'm assuming 
it's not as simple as that. i'll take a look at the message passing api and 
will post here if/when i come up with a test release or something. may take a 
while though.

Original comment by jul...@gmail.com on 30 Dec 2012 at 11:54

GoogleCodeExporter commented 9 years ago
add the attached file as an extension as described in TryNewCode

in your extension, you'll want to use code like this to have RTA re-scan the 
elements of the document:

{{{
chrome.extension.sendMessage("oabphaconndgibllomdcjbfdghcmenci", {action: 
"catchLinks"},
  function(response) {
    console.debug(response)
  });
}}}

where oabphaconndgibllomdcjbfdghcmenci is the official extension ID of RTA. 
note that this string will be different when you add RTA from the zip file; 
look at chrome://extensions/ to find out what you'll need to use. to address 
the chrome webstore version (in case i release the changes like this), you'll 
need to change it back to the version above.

Original comment by jul...@gmail.com on 30 Dec 2012 at 12:58

Attachments:

GoogleCodeExporter commented 9 years ago
ugh, google code comments are stupid.. use this:
chrome.extension.sendMessage("oabphaconndgibllomdcjbfdghcmenci", {action: 
"catchLinks"}, function(response) {
    console.debug(response);
  }
);

Original comment by jul...@gmail.com on 30 Dec 2012 at 1:01

GoogleCodeExporter commented 9 years ago
orphaned.

Original comment by jul...@gmail.com on 11 Jan 2014 at 12:35