Commit 2cfd83be authored by Alex Catarineu's avatar Alex Catarineu Committed by Richard Pospesel
Browse files

Bug 10760: Integrate TorButton to TorBrowser core

Because of the non-restartless nature of Torbutton, it required
a two-stage installation process. On mobile, it was a problem,
because it was not loading when the user opened the browser for
the first time.

Moving it to tor-browser and making it a system extension allows it
to load when the user opens the browser for first time.

Additionally, this patch also fixes Bug 27611.

Bug 26321: New Circuit and New Identity menu items

Bug 14392: Make about:tor behave like other initial pages.

Bug 25013: Add torbutton as a tor-browser submodule

Bug 31575: Replace Firefox Home (newtab) with about:tor

Avoid loading AboutNewTab in BrowserGlue.jsm in order
to avoid several network requests that we do not need. Besides,
about:newtab will now point to about:blank or about:tor (depending
on browser.newtabpage.enabled) and about:home will point to
about:tor.
parent 71edbd97
Loading
Loading
Loading
Loading

.gitmodules

0 → 100644
+3 −0
Original line number Diff line number Diff line
[submodule "toolkit/torproject/torbutton"]
	path = toolkit/torproject/torbutton
	url = https://git.torproject.org/torbutton.git
+25 −13
Original line number Diff line number Diff line
@@ -7,11 +7,11 @@
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/content/aboutDialog.css" type="text/css"?>
<?xml-stylesheet href="chrome://branding/content/aboutDialog.css" type="text/css"?>
<?xml-stylesheet href="chrome://torbutton/skin/aboutDialog.css" type="text/css"?>

<!-- We need to include the localization DTDs until we migrate to Fluent -->
<!DOCTYPE window [
#ifdef XP_MACOSX
#include browser-doctype.inc
#endif
]>

<window xmlns:html="http://www.w3.org/1999/xhtml"
@@ -28,7 +28,7 @@
        data-l10n-id="aboutDialog-title"
#endif
        role="dialog"
        aria-describedby="version distribution distributionId communityDesc contributeDesc trademark"
        aria-describedby="version distribution distributionId projectDesc helpDesc trademark trademarkTor"
        >
#ifdef XP_MACOSX
#include macWindow.inc.xhtml
@@ -146,24 +146,36 @@
              <label is="text-link" useoriginprincipal="true" href="about:credits" data-l10n-name="community-exp-creditsLink"/>
            </description>
          </vbox>
          <description class="text-blurb" id="communityDesc" data-l10n-id="community-2">
            <label is="text-link" href="https://www.mozilla.org/?utm_source=firefox-browser&#38;utm_medium=firefox-desktop&#38;utm_campaign=about-dialog" data-l10n-name="community-mozillaLink"/>
            <label is="text-link" useoriginprincipal="true" href="about:credits" data-l10n-name="community-creditsLink"/>
          <!-- Keep communityDesc and contributeDesc to avoid JS errors trying to hide them -->
          <description class="text-blurb" id="communityDesc" data-l10n-id="community-2" hidden="true"></description>
          <description class="text-blurb" id="contributeDesc" data-l10n-id="helpus" hidden="true"></description>
          <description class="text-blurb" id="projectDesc">
            &project.start;
            <label is="text-link" href="https://www.torproject.org/">
              &project.tpoLink;
            </label>&project.end;
          </description>
          <description class="text-blurb" id="contributeDesc" data-l10n-id="helpus">
            <label is="text-link" href="https://donate.mozilla.org/?utm_source=firefox&#38;utm_medium=referral&#38;utm_campaign=firefox_about&#38;utm_content=firefox_about" data-l10n-name="helpus-donateLink"/>
            <label is="text-link" href="https://www.mozilla.org/contribute/?utm_source=firefox-browser&#38;utm_medium=firefox-desktop&#38;utm_campaign=about-dialog" data-l10n-name="helpus-getInvolvedLink"/>
          <description class="text-blurb" id="helpDesc">
            &help.start;
            <label is="text-link" href="https://donate.torproject.org/">
              &help.donateLink;
            </label>
            &help.or;
            <label is="text-link" href="https://community.torproject.org/">
              &help.getInvolvedLink;
            </label>&help.end;
          </description>
        </vbox>
      </vbox>
    </hbox>
    <vbox id="bottomBox">
      <hbox pack="center">
        <label is="text-link" class="bottom-link" useoriginprincipal="true" href="about:license" data-l10n-id="bottomLinks-license"/>
        <label is="text-link" class="bottom-link" useoriginprincipal="true" href="about:rights" data-l10n-id="bottomLinks-rights"/>
        <label is="text-link" class="bottom-link" href="https://www.mozilla.org/privacy/?utm_source=firefox-browser&#38;utm_medium=firefox-desktop&#38;utm_campaign=about-dialog" data-l10n-id="bottomLinks-privacy"/>
      <hbox id="newBottom" pack="center" position="1">
        <label is="text-link" class="bottom-link" href="https://support.torproject.org/">&bottomLinks.questions;</label>
        <label is="text-link" class="bottom-link" href="https://community.torproject.org/relay/">&bottomLinks.grow;</label>
        <label is="text-link" class="bottom-link" useoriginprincipal="true" href="about:license">&bottomLinks.license;</label>
      </hbox>
      <description id="trademark" data-l10n-id="trademarkInfo"></description>
      <description id="trademarkTor">&tor.TrademarkStatement;</description>
    </vbox>
  </vbox>

+26 −2
Original line number Diff line number Diff line
@@ -45,7 +45,8 @@
                     class="subviewbutton subviewbutton-iconic"
                     data-l10n-id="appmenuitem-new-private-window"
                     key="key_privatebrowsing"
                     command="Tools:PrivateBrowsing"/>
                     command="Tools:PrivateBrowsing"
                     hidden="true"/>
#ifdef NIGHTLY_BUILD
      <toolbarbutton id="appMenu-fission-window-button"
                     class="subviewbutton subviewbutton-iconic"
@@ -61,7 +62,19 @@
      <toolbarbutton id="appMenuRestoreLastSession"
                     data-l10n-id="appmenu-restore-session"
                     class="subviewbutton subviewbutton-iconic"
                     command="Browser:RestoreLastSession"/>
                     command="Browser:RestoreLastSession"
                     hidden="true"/>
      <toolbarseparator/>
      <toolbarbutton id="appMenuNewIdentity"
                     class="subviewbutton subviewbutton-iconic"
                     key="torbutton-new-identity-key"
                     label="&torbutton.context_menu.new_identity;"
                     oncommand="torbutton_new_identity();"/>
      <toolbarbutton id="appMenuNewCircuit"
                     class="subviewbutton subviewbutton-iconic"
                     key="torbutton-new-circuit-key"
                     label="&torbutton.context_menu.new_circuit;"
                     oncommand="torbutton_new_circuit();"/>
      <toolbarseparator/>
      <toolbaritem id="appMenu-zoom-controls" class="toolbaritem-combined-buttons" closemenu="none">
        <!-- Use a spacer, because panel sizing code gets confused when using CSS methods. -->
@@ -256,6 +269,17 @@
                     key="key_privatebrowsing"
                     command="Tools:PrivateBrowsing"/>
      <toolbarseparator/>
      <toolbarbutton id="appMenuNewIdentity"
                     class="subviewbutton"
                     key="torbutton-new-identity-key"
                     label="&torbutton.context_menu.new_identity_sentence_case;"
                     oncommand="torbutton_new_identity();"/>
      <toolbarbutton id="appMenuNewCircuit"
                     class="subviewbutton"
                     key="torbutton-new-circuit-key"
                     label="&torbutton.context_menu.new_circuit_sentence_case;"
                     oncommand="torbutton_new_circuit();"/>
      <toolbarseparator/>
      <toolbarbutton id="appMenu-bookmarks-button"
                     class="subviewbutton subviewbutton-nav"
                     data-l10n-id="library-bookmarks-menu"
+6 −0
Original line number Diff line number Diff line
@@ -6,3 +6,9 @@
%textcontextDTD;
<!ENTITY % placesDTD SYSTEM "chrome://browser/locale/places/places.dtd">
%placesDTD;
<!ENTITY % torbuttonDTD SYSTEM "chrome://torbutton/locale/torbutton.dtd">
%torbuttonDTD;
<!ENTITY % aboutTorDTD SYSTEM "chrome://torbutton/locale/aboutTor.dtd">
%aboutTorDTD;
<!ENTITY % aboutDialogDTD SYSTEM "chrome://torbutton/locale/aboutDialog.dtd">
%aboutDialogDTD;
+34 −11
Original line number Diff line number Diff line
@@ -38,6 +38,18 @@
                          command="Tools:NonFissionWindow"
                          accesskey="s" label="New Non-Fission Window"/>
#endif
                <menuseparator/>
                <menuitem id="menu_newIdentity"
                          accesskey="&torbutton.context_menu.new_identity_key;"
                          key="torbutton-new-identity-key"
                          label="&torbutton.context_menu.new_identity;"
                          oncommand="torbutton_new_identity();"/>
                <menuitem id="menu_newCircuit"
                          accesskey="&torbutton.context_menu.new_circuit_key;"
                          key="torbutton-new-circuit-key"
                          label="&torbutton.context_menu.new_circuit;"
                          oncommand="torbutton_new_circuit();"/>
                <menuseparator/>
                <menuitem id="menu_openLocation"
                          hidden="true"
                          command="Browser:OpenLocation"
@@ -463,23 +475,34 @@
              <menupopup id="menu_HelpPopup" onpopupshowing="buildHelpMenu();">
<!-- Note: Items under here are cloned to the AppMenu Help submenu. The cloned items
     have their strings defined by appmenu-data-l10n-id. -->
                <menuitem id="menu_openHelp"
                <!-- dummy elements to avoid 'getElementById' errors -->
                <box id="feedbackPage"/>
                <box id="helpSafeMode"/>
                <box id="menu_HelpPopup_reportPhishingtoolmenu"/>
                <box id="menu_HelpPopup_reportPhishingErrortoolmenu"/>
                <!-- Add Tor Browser manual link -->
                <menuitem id="torBrowserUserManual"
                          oncommand="gBrowser.selectedTab = gBrowser.addTab('https://tb-manual.torproject.org/' + Services.locale.requestedLocale, {triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal()});"
                          label="&aboutTor.torbrowser_user_manual.label;"
                          accesskey="&aboutTor.torbrowser_user_manual.accesskey;"/>
                <!-- Bug 18905: Hide unused help menu items -->
                <!-- <menuitem id="menu_openHelp"
                          oncommand="openHelpLink('firefox-help')"
                          data-l10n-id="menu-get-help"
                          appmenu-data-l10n-id="appmenu-get-help"
#ifdef XP_MACOSX
                          key="key_openHelpMac"/>
                          key="key_openHelpMac"/> -->
#else
                          />
                          /> -->
#endif
                <menuitem id="feedbackPage"
                <!-- <menuitem id="feedbackPage"
                          oncommand="openFeedbackPage()"
                          data-l10n-id="menu-help-feedback-page"
                          appmenu-data-l10n-id="appmenu-help-feedback-page"/>
                <menuitem id="helpSafeMode"
                          appmenu-data-l10n-id="appmenu-help-feedback-page"/> -->
                <!-- <menuitem id="helpSafeMode"
                          oncommand="safeModeRestart();"
                          data-l10n-id="menu-help-enter-troubleshoot-mode2"
                          appmenu-data-l10n-id="appmenu-help-enter-troubleshoot-mode2"/>
                          appmenu-data-l10n-id="appmenu-help-enter-troubleshoot-mode2"/> -->
                <menuitem id="troubleShooting"
                          oncommand="openTroubleshootingPage()"
                          data-l10n-id="menu-help-more-troubleshooting-info"
@@ -489,18 +512,18 @@
                          data-l10n-id="menu-help-report-site-issue"
                          appmenu-data-l10n-id="appmenu-help-report-site-issue"
                          hidden="true"/>
                <menuitem id="menu_HelpPopup_reportPhishingtoolmenu"
                <!-- <menuitem id="menu_HelpPopup_reportPhishingtoolmenu"
                          disabled="true"
                          oncommand="openUILink(gSafeBrowsing.getReportURL('Phish'), event, {triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({})});"
                          hidden="true"
                          data-l10n-id="menu-help-report-deceptive-site"
                          appmenu-data-l10n-id="appmenu-help-report-deceptive-site"/>
                <menuitem id="menu_HelpPopup_reportPhishingErrortoolmenu"
                          appmenu-data-l10n-id="appmenu-help-report-deceptive-site"/> -->
                <!-- <menuitem id="menu_HelpPopup_reportPhishingErrortoolmenu"
                          disabled="true"
                          oncommand="ReportFalseDeceptiveSite();"
                          data-l10n-id="menu-help-not-deceptive"
                          appmenu-data-l10n-id="appmenu-help-not-deceptive"
                          hidden="true"/>
                          hidden="true"/> -->
                <menuseparator id="aboutSeparator"/>
                <menuitem id="aboutName"
                          oncommand="openAboutDialog();"
Loading