Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

background.js 1.1KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /* Enables the page action (i.e., the browser toolbar icon).
  2. */
  3. chrome.runtime.onInstalled.addListener(() => {
  4. chrome.declarativeContent.onPageChanged.removeRules(undefined, () => {
  5. chrome.declarativeContent.onPageChanged.addRules([{
  6. conditions: [ new chrome.declarativeContent.PageStateMatcher({
  7. pageUrl: { },
  8. })
  9. ], actions: [ new chrome.declarativeContent.ShowPageAction() ]
  10. }]);
  11. });
  12. });
  13. /* Toggle the toolbar icon based on whether stickies are, or are not, set to
  14. be killed on the current tab.
  15. This listener receives a message from the content script (contentScript.js);
  16. the content script actually determines what the settings for the current
  17. tab are.
  18. */
  19. chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
  20. let icons = request.killingStickies ? {
  21. "16": "images/ASK_on_16.png",
  22. "32": "images/ASK_on_32.png",
  23. "48": "images/ASK_on_48.png",
  24. "128": "images/ASK_on_128.png"
  25. } : {
  26. "16": "images/ASK_off_16.png",
  27. "32": "images/ASK_off_32.png",
  28. "48": "images/ASK_off_48.png",
  29. "128": "images/ASK_off_128.png"
  30. };
  31. chrome.pageAction.setIcon({
  32. path: icons,
  33. tabId: sender.tab.id
  34. });
  35. });