-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvbutton.js
More file actions
42 lines (37 loc) · 1.27 KB
/
Copy pathvbutton.js
File metadata and controls
42 lines (37 loc) · 1.27 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
38
39
40
41
42
// Tnx to Luetage who originally did this for me ^^ -- https://github.com/luetage
// Quite EXPERIMENTAL. Still have to refine this
(function () {
function style() {
const style = document.createElement('style');
style.type = 'text/css';
style.id = 'mvVivbtn';
style.innerHTML = `
#browser.native #header {display: none !important;}
:not(.native) #header {display: block !important;}
.vivaldi {position: relative;}
.native .vivaldi {margin-top: 5px;}
:not(.native) .vivaldi {margin-top: 2px;}
.native:not(.tabs-top) .burger-icon {margin-top: 2px; margin-right: -5px;}
`;
document.getElementsByTagName('head')[0].appendChild(style);
};
function mvVivbtn() {
style();
var btn = document.querySelector(".vivaldi");
btn.setAttribute('tabindex', '-1');
var bar = document.querySelector(".UrlBar.toolbar.toolbar-mainbar.toolbar-large");
var div = document.createElement('div');
div.classList.add('button-toolbar');
bar.insertBefore(div, bar.firstChild);
div.appendChild(btn);
}
setTimeout(function wait() {
const browser = document.getElementById('browser');
if (browser) {
mvVivbtn();
}
else {
setTimeout(wait, 300);
}
});
})();