[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #12684 [Firefox Patch Issues]: Make "Not Now" the default button for TorBrowser's canvas permission dialogue



#12684: Make "Not Now" the default button for TorBrowser's canvas permission
dialogue
-------------------------------------+-------------------------------------
     Reporter:  isis                 |      Owner:  mikeperry
         Type:  defect               |     Status:  needs_revision
     Priority:  critical             |  Milestone:
    Component:  Firefox Patch        |    Version:
  Issues                             |   Keywords:  tbb-usability, tbb-
   Resolution:                       |  linkability
Actual Points:                       |  Parent ID:
       Points:                       |
-------------------------------------+-------------------------------------

Comment (by isis):

 Replying to [comment:4 gk]:
 > Replying to [comment:3 isis]:
 > > The dialogue is also vague as to which thing to "Allow in the Future".
 It could be read as "Allow TorBrowser to send blank canvases in the
 Future" ''or'' "Allow this site to access the canvas in the Future".
 > >
 > > I made a simple patch to `src/chrome/locale/en/torbutton.properties`
 to fix this, it's in my `bug12684-explain-canvas-permissions`
 [https://github.com/isislovecruft/torbutton/tree/bug12684-explain-canvas-
 permissions branch].
 >
 > I wonder whether we really want to make the text in the popup even
 longer given that a lot of people are presumably stopping to read it while
 trying to parse the first sentence. So, maybe we should be smarter here
 and rephrase the whole dialog in a way that fixes both problems.

 I agree, actually. I just thought adding more explanation was clearer and
 more likely to get merged than rewriting the whole UI string. But if
 everyone is opting for shorter messages... then scrap my last patch.

 FWIW, I tried to patch TorBrowser, in `tor-
 browser.git/browser/base/content/browser.js`, around L6030:

 {{{
 diff --git i/browser/base/content/browser.js
 w/browser/base/content/browser.js
 index 1df295a..d22058b 100644
 --- i/browser/base/content/browser.js
 +++ w/browser/base/content/browser.js
 @@ -6076,13 +6076,7 @@ var CanvasPermissionPromptHelper = {

      var message = getLocalizedString("canvas.siteprompt", [ uri.asciiHost
 ]);

 -    var mainAction = {
 -      label: getLocalizedString("canvas.allow"),
 -      accessKey: getLocalizedString("canvas.allowAccessKey"),
 -      callback: function() {
 -          setCanvasPermission(uri, Ci.nsIPermissionManager.ALLOW_ACTION);
 -      }
 -    };
 +    var mainAction = null; /* Not now */

      var secondaryActions = [
        {
 @@ -6091,7 +6085,14 @@ var CanvasPermissionPromptHelper = {
          callback: function() {
            setCanvasPermission(uri, Ci.nsIPermissionManager.DENY_ACTION);
          }
 -      }
 +      },
 +      {
 +        label: getLocalizedString("canvas.allow"),
 +        accessKey: getLocalizedString("canvas.allowAccessKey"),
 +        callback: function() {
 +            setCanvasPermission(uri,
 Ci.nsIPermissionManager.ALLOW_ACTION);
 +        }
 +      }
      ];

      // Since we have a process in place to perform localization for the
 }}}

 I re-zipped that into `tor-browser_en-US/Browser/browser/omni.ja` in my
 browser tree, and restarted the browser several times, but debug logs gave
 me no idea why it wasn't running. And [https://developer.mozilla.org/en-
 US/docs/Mozilla/JavaScript_code_modules/PopupNotifications.jsm#Notification_options
 MDN didn't help]. Bad JS syntax? Any idea what I did wrong?

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/12684#comment:7>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs