Commit 330fe3cc authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃
Browse files

fixup! TB 21952: Implement Onion-Location

No more inline event handlers
parent f8c12ae5
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -227,6 +227,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
+8 −1
Original line number Diff line number Diff line
@@ -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) {
+1 −2
Original line number Diff line number Diff line
@@ -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>