-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathmain.js
More file actions
37 lines (33 loc) · 1.01 KB
/
main.js
File metadata and controls
37 lines (33 loc) · 1.01 KB
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
33
34
35
36
37
function updateWebviews(){
var webview = document.querySelector("webview");
webview.style.height = document.documentElement.clientHeight + 'px';
webview.style.width = document.documentElement.clientWidth + 'px';
}
function injectCSS(){
var webview = document.querySelector("webview");
webview.addContentScripts([
{
name: 'updatedCSS',
matches: ['https://calendar.google.com/calendar/render/*'],
css: { files: ['important.css'] },
run_at: 'document_start'
}
]);
}
function setup(){
updateWebviews();
injectCSS();
var webview = document.querySelector('webview');
webview.src = 'http://calendar.google.com';
webview.setZoom(1.1);
webview.addContentScripts([
{
name: 'injectedJS',
matches: ['https://calendar.google.com/calendar/render/*'],
js: { files: ['app_changes.js'] },
run_at: 'document_end'
}
]);
}
onload = setup;
window.onresize = updateWebviews;