-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackground.js
32 lines (28 loc) · 900 Bytes
/
background.js
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
29
30
31
32
chrome.app.runtime.onLaunched.addListener(function(launchData) {
var displayDimensions = calcNaClAppResolution();
chrome.app.window.create('index.html', {
id: getSenetWindowId(),
bounds: {
width: displayDimensions.width,
height: displayDimensions.height
},
resizable: false
});
});
chrome.runtime.onInstalled.addListener(function() {
console.log('installed');
});
chrome.runtime.onSuspend.addListener(function() {
// Do some simple clean-up tasks.
});
chrome.browserAction.onClicked.addListener(function(tab) {
// ...
});
chrome.action.onClicked.addListener(tab => {
chrome.windows.create({
url: chrome.runtime.getURL("index.html"),
type: "popup" //No Address bar
//In here you can also add constrain for the window
//This is for manifest v3
})
);