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

Tor Bug Tracker & Wiki blackhole at torproject.org
Fri Aug 15 03:28:23 UTC 2014


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

 * status:  needs_information => needs_revision


Comment:

 Replying to [comment:25 isis]:
 > Replying to [comment:21 mcs]:
 > > Replying to [comment:18 isis]:
 > > > Problem !#1: That `<separator class="groove">` part between the
 sentences. For the life of me, I can't get this thing to insert a newline.
 I've tried `\n\n`, a [https://developer.mozilla.org/en-
 US/docs/Mozilla/Tech/XUL/separator XUL separator] and a
 [https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/spacer XUL
 spacer]. All of them actually show up in the text.
 > >
 > > The text ends up in a XUL <description> element.  If we can apply a
 CSS rule like white-space: pre-wrap, then newlines (\n) will not be
 ignored.  There might be a better way, but here is something that seems to
 work:  add the following code to the CanvasPermissionPromptHelper_init()
 function:
 > > {{{
 > > if (document.styleSheets && (document.styleSheets.length > 0)) try {
 > >   let ruleText = "panel[popupid=canvas-permissions-prompt] description
 { white-space: pre-wrap";
 > >   let sheet = document.styleSheets[0];
 > >   sheet.insertRule(ruleText, sheet.cssRules.length);
 > > } catch (e) {}
 > >
 > > }}}
 >
 > Okay, I added that stanza after the
 >
 >     {{{Services.obs.addObserver(this, this._permissionsPrompt,
 false);}}}
 >
 > line, and rebuilt Firefox. However, the resulting build was all kinds of
 broken, and running the `firefox` binary with `-jsconsole` had some errors
 about unterminated string literals in `browser/content/browser.js`.
 >
 > I thought it was due to the missing CSS `}` at the end of the `ruleText`
 variable above, but after adding the `}` and rebuilding a second time it
 still came out janky and broken.
 >
 > Was I supposed to add the CSS hack before the ServiceObserver gets
 added?

 Yep, it needed to ''before'' the ServiceObserver gets added. Everything
 works great now.

 Here's what it looks like:

 [[Image()]]

 The only thing not working is my patch to change the (?) question mark
 icon into a little (freely-licensed) painter's palette. I think I just put
 the icon files in the wrong folder, probably. It's kind of hard to tell
 where files end up when the whole browser is built.

 And, obviously, as mentioned previously, the double "Not Now" thing will
 have to wait until FF31 to get fixed.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/12684#comment:26>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list