88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
-
-
-
-
-
+
+
+
+
+
|
this.xButton.style.left = `${oCoord.left}px`;
}
}
insertIntoPage () {
this.bShadow = document.body.createShadowRoot || document.body.attachShadow;
if (this.bShadow) {
this.xShadowBtn = oGrammalecte.createNode("div", { style: "display:none; position:absolute; width:0; height:0;" });
this.xShadowBtnNode = this.xShadowBtn.attachShadow({ mode: "open" });
oGrammalecte.createStyle("content_scripts/menu.css", null, this.xShadowBtnNode);
this.xShadowBtnNode.appendChild(this.xButton);
document.body.appendChild(this.xShadowBtnNode);
this.xShadowHost = oGrammalecte.createNode("div", { id: "grammalecte_menu_main_button_shadow_host", style: "width:0; height:0;" });
this.xShadowRoot = this.xShadowHost.attachShadow({ mode: "open" });
oGrammalecte.createStyle("content_scripts/menu.css", null, this.xShadowRoot);
this.xShadowRoot.appendChild(this.xButton);
document.body.appendChild(this.xShadowHost);
}
else {
if (!document.getElementById("grammalecte_cssmenu")) {
oGrammalecte.createStyle("content_scripts/menu.css", "grammalecte_cssmenu", document.head);
}
document.body.appendChild(this.xButton);
}
|