Closed deweller closed 9 years ago
I found http://stackoverflow.com/a/14656720 for a good explanation of the technique involved here.
Since all you need is the URL of the chrome extension and the pockets image, my solution is to store that info in hidden div's so that you can call it whenever you need. See example here, https://github.com/loon3/Tokenly-Pockets/blob/master/Chrome%20Extension/test/paymentbutton_example.js
So in this case, you'll need two hidden div's with the classes .pockets-url and .pockets-image
Revise content script to use data attributes...
<div data-pockets-url></div>
$(‘div[data-pockets-url]’).text()
Some applications (like Swapbot) need to generate payment buttons via javascript after the pages have loaded.
Because of this, the
<span>
is not picked up and handled by the extension.Maybe we can add a listener event to the the
tipbutton.js
content script that listens for a request from the page to look again for any tip buttons. It might look something like this: