Skip to content

Instantly share code, notes, and snippets.

@WebDevBooster
Forked from ramsaylanier/background.js
Created December 17, 2017 23:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WebDevBooster/24a498b2dbd43459101b9be9592be37e to your computer and use it in GitHub Desktop.
Save WebDevBooster/24a498b2dbd43459101b9be9592be37e to your computer and use it in GitHub Desktop.
Setup Page Action on Certain URLS
chrome.runtime.onInstalled.addListener(function() {
chrome.declarativeContent.onPageChanged.removeRules(undefined, function() {
chrome.declarativeContent.onPageChanged.addRules([
{
conditions: [
new chrome.declarativeContent.PageStateMatcher({
pageUrl: { urlContains: 'slides.com' },
})
],
actions: [
new chrome.declarativeContent.ShowPageAction()
]
}
]);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment