Guest User

Untitled

a guest
Jan 17th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. chrome.tabs.onUpdated.addListener(function(tabId,changeInfo,tab) {
  2. if(changeInfo.url){
  3. console.log("tab url changed");
  4. chrome.tabs.executeScript(null, {file: "js/jquery-3.2.1.min.js"});
  5. chrome.tabs.executeScript(null, {file: "payload.js"});
  6. }
  7.  
  8. });
  9.  
  10. console.log("ready");
  11. $(document).ready(function() {
  12. var button = document.getElementsByClassName("recommend u-flexColumn u-marginBottom10 u-width60")[0];
  13. if (button) {
  14. console.log("element is ready");
  15. }
  16. });
  17.  
  18. chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
  19. if (changeInfo.url) {
  20. console.log("tab url changed");
  21. chrome.tabs.executeScript(tabId, {file: "js/jquery-3.2.1.min.js"});
  22. chrome.tabs.executeScript(tabId, {file: "payload.js"});
  23. }
  24. });
Add Comment
Please, Sign In to add comment