You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
602 B

  1. chrome.runtime.onInstalled.addListener(function() {
  2. chrome.storage.sync.set({color: '#3aa757'}, function() {
  3. console.log("The color is green.");
  4. });
  5. chrome.declarativeContent.onPageChanged.removeRules(undefined, function() {
  6. chrome.declarativeContent.onPageChanged.addRules([{
  7. conditions: [new chrome.declarativeContent.PageStateMatcher({
  8. pageUrl: {hostEquals: 'developer.chrome.com'},
  9. })
  10. ],
  11. actions: [new chrome.declarativeContent.ShowPageAction()]
  12. }]);
  13. });
  14. let i = 0;
  15. setInterval(() => {
  16. console.log(`${++i}s since start`)
  17. }, 1000);
  18. });