Advertisement
Guest User

Untitled

a guest
Oct 25th, 2014
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab){
  2. function(tabId, changeInfo, tab){
  3. //using tab.url and XMLHttpRequest() i get newText for:
  4. chrome.browserAction.setBadgeText({text: newText});
  5. };
  6. });
  7.  
  8. chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab){
  9. function(tabId, changeInfo, tab){
  10. if(!changeInfo.url) return; // URL did not change
  11. // Might be better to analyze the URL to exclude things like anchor changes
  12.  
  13. /* ... */
  14. chrome.browserAction.setBadgeText({text: newText}, tab.id);
  15. };
  16. });
  17.  
  18. chrome.browserAction.setBadgeText({text: newText}, tab.id); //<<this is not working to me
  19.  
  20. chrome.browserAction.setBadgeText({text: "Phish", tabId: tab.id}); //<<This is working to me
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement