Skip to content
Snippets Groups Projects
Commit e4fe52d0 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame :jack_o_lantern:
Browse files

fixup! TB 21952: Implement Onion-Location

No more inline event handlers
parent a852d2b8
No related branches found
No related tags found
1 merge request!1505BB/TB 43416: Rebased onto 135.0a1
......@@ -281,6 +281,9 @@ var gBrowserInit = {
// Init the OnionAuthPrompt
OnionAuthPrompt.init();
// Init the Onion Location pill
OnionLocationParent.init(document);
gTorCircuitPanel.init();
// Certain kinds of automigration rely on this notification to complete
......
......@@ -34,12 +34,19 @@ export class OnionLocationParent extends JSWindowActorParent {
// Listeners are added in BrowserGlue.jsm
receiveMessage(aMsg) {
switch (aMsg.name) {
case "OnionLocation:Set":
case "OnionLocation:Set": {
let browser = this.browsingContext.embedderElement;
OnionLocationParent.setOnionLocation(browser);
break;
}
}
}
static init(document) {
document
.getElementById(ONIONLOCATION_BOX_ID)
.addEventListener("click", event => this.buttonClick(event));
}
static buttonClick(event) {
if (event.button !== 0) {
......
......@@ -3,8 +3,7 @@
<hbox id="onion-location-box"
class="tor-button tor-urlbar-button"
role="button"
hidden="true"
onclick="OnionLocationParent.buttonClick(event);">
hidden="true">
<image id="onion-location-button" role="presentation"/>
<label id="onion-label"/>
</hbox>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment