forked from ihatecsv/ControlStadia
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackground.js
More file actions
28 lines (28 loc) · 1006 Bytes
/
background.js
File metadata and controls
28 lines (28 loc) · 1006 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
chrome.runtime.onInstalled.addListener(function() {
chrome.declarativeContent.onPageChanged.removeRules(undefined, function() {
chrome.declarativeContent.onPageChanged.addRules([{
conditions: [
new chrome.declarativeContent.PageStateMatcher({
pageUrl: {hostEquals: "stadia.google.com"},
}),
new chrome.declarativeContent.PageStateMatcher({
pageUrl: {hostEquals: "gamepad-tester.com"},
}),
],
actions: [new chrome.declarativeContent.ShowPageAction()]
}]);
});
const startParams = {
"firstRun": true
};
chrome.storage.sync.get([
"firstRun"
], function(settings) {
for(const key of Object.keys(settings)){
startParams[key] = settings[key];
}
chrome.storage.sync.set(startParams, function() {
console.log("ControlStadia: Set start params!");
});
});
});