Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 5294633391226880: issue 1435 - Port popup.html from Chrome/Safari/Opera to Firefox (Closed)

Created:
Sept. 26, 2014, 12:48 p.m. by saroyanm
Modified:
Jan. 12, 2017, 3:23 p.m.
Visibility:
Public.

Description

This review is related to current ticket: https://issues.adblockplus.org/ticket/1435

Patch Set 1 #

Total comments: 47

Patch Set 2 : #

Total comments: 20

Patch Set 3 : #

Total comments: 17

Patch Set 4 : #

Total comments: 7

Patch Set 5 : #

Total comments: 10

Patch Set 6 : #

Total comments: 33

Patch Set 7 : #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+633 lines, -114 lines) Patch
A chrome/content/ui/ext/common.js View 1 2 3 4 5 6 1 chunk +98 lines, -0 lines 0 comments Download
A chrome/content/ui/ext/popup.js View 1 2 3 4 5 6 1 chunk +86 lines, -0 lines 0 comments Download
M chrome/content/ui/firstRun.html View 1 2 3 4 5 6 1 chunk +1 line, -3 lines 0 comments Download
M chrome/content/ui/i18n.js View 2 3 chunks +3 lines, -74 lines 0 comments Download
M chrome/content/ui/overlay.xul View 1 2 3 4 5 2 chunks +34 lines, -31 lines 0 comments Download
A chrome/content/ui/popup.html View 1 2 3 4 1 chunk +69 lines, -0 lines 0 comments Download
A chrome/content/ui/popup.js View 1 2 3 4 5 1 chunk +110 lines, -0 lines 0 comments Download
M chrome/content/ui/utils.js View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 1 comment Download
A chrome/locale/en-US/popup.properties View 1 2 3 4 5 6 1 chunk +10 lines, -0 lines 0 comments Download
M chrome/skin/overlay.css View 1 chunk +7 lines, -1 line 0 comments Download
A chrome/skin/popup.css View 1 2 3 4 1 chunk +181 lines, -0 lines 0 comments Download
A chrome/skin/popup.png View Binary file 0 comments Download
M lib/ui.js View 1 2 3 4 5 6 6 chunks +33 lines, -5 lines 0 comments Download

Messages

Total messages: 17
saroyanm
Sorry guys, for the delay, took little while splitting the patch. Please have a look ...
Sept. 26, 2014, 1:26 p.m. (2014-09-26 13:26:02 UTC) #1
Thomas Greiner
http://codereview.adblockplus.org/5294633391226880/diff/5629499534213120/chrome/content/ui/ext/common.js File chrome/content/ui/ext/common.js (right): http://codereview.adblockplus.org/5294633391226880/diff/5629499534213120/chrome/content/ui/ext/common.js#newcode20 chrome/content/ui/ext/common.js:20: var UI = require("ui").UI; We can make use of ...
Sept. 29, 2014, 4:19 p.m. (2014-09-29 16:19:48 UTC) #2
saroyanm
Thanks Thomas for your comments, I'm going to investigate scrollHeight (+11) further and hope to ...
Oct. 2, 2014, 7:53 a.m. (2014-10-02 07:53:56 UTC) #3
saroyanm
http://codereview.adblockplus.org/5294633391226880/diff/5629499534213120/chrome/content/ui/ext/popup.js File chrome/content/ui/ext/popup.js (right): http://codereview.adblockplus.org/5294633391226880/diff/5629499534213120/chrome/content/ui/ext/popup.js#newcode40 chrome/content/ui/ext/popup.js:40: iframe.parentNode.sizeTo(document.body.scrollWidth, document.body.offsetHeight + 11); On 2014/10/02 07:53:56, saroyanm wrote: ...
Oct. 7, 2014, 1:02 p.m. (2014-10-07 13:02:05 UTC) #4
Thomas Greiner
http://codereview.adblockplus.org/5294633391226880/diff/5629499534213120/chrome/content/ui/ext/common.js File chrome/content/ui/ext/common.js (right): http://codereview.adblockplus.org/5294633391226880/diff/5629499534213120/chrome/content/ui/ext/common.js#newcode20 chrome/content/ui/ext/common.js:20: var UI = require("ui").UI; On 2014/10/02 07:53:56, saroyanm wrote: ...
Oct. 8, 2014, 10:40 a.m. (2014-10-08 10:40:42 UTC) #5
saroyanm
@Thomas thanks for comments, looks more is comming :) Please have a look when you ...
Oct. 10, 2014, 12:05 p.m. (2014-10-10 12:05:58 UTC) #6
Thomas Greiner
http://codereview.adblockplus.org/5294633391226880/diff/5629499534213120/chrome/content/ui/popup.js File chrome/content/ui/popup.js (right): http://codereview.adblockplus.org/5294633391226880/diff/5629499534213120/chrome/content/ui/popup.js#newcode93 chrome/content/ui/popup.js:93: if (!ext.showBlockable()) On 2014/10/10 12:05:58, saroyanm wrote: > On ...
Oct. 13, 2014, 1:18 p.m. (2014-10-13 13:18:23 UTC) #7
saroyanm
I guess we are near. http://codereview.adblockplus.org/5294633391226880/diff/5764640680181760/chrome/content/ui/ext/common.js File chrome/content/ui/ext/common.js (right): http://codereview.adblockplus.org/5294633391226880/diff/5764640680181760/chrome/content/ui/ext/common.js#newcode111 chrome/content/ui/ext/common.js:111: if (info.active && info.lastFocusedWindow) ...
Oct. 16, 2014, 11:26 a.m. (2014-10-16 11:26:15 UTC) #8
Thomas Greiner
Only some minor changes remaining. http://codereview.adblockplus.org/5294633391226880/diff/5764640680181760/chrome/content/ui/popup.js File chrome/content/ui/popup.js (right): http://codereview.adblockplus.org/5294633391226880/diff/5764640680181760/chrome/content/ui/popup.js#newcode1 chrome/content/ui/popup.js:1: /* On 2014/10/16 11:26:15, ...
Oct. 16, 2014, 1:39 p.m. (2014-10-16 13:39:44 UTC) #9
saroyanm
Sorry for delay Thomas, Updated. http://codereview.adblockplus.org/5294633391226880/diff/5150194068881408/chrome/content/ui/popup.html File chrome/content/ui/popup.html (right): http://codereview.adblockplus.org/5294633391226880/diff/5150194068881408/chrome/content/ui/popup.html#newcode52 chrome/content/ui/popup.html:52: <span class="i18n_blockable_items"></span> On 2014/10/16 ...
Oct. 17, 2014, 11:42 a.m. (2014-10-17 11:42:14 UTC) #10
Thomas Greiner
Went through the whole code again and found one oddity in lib/ui.js http://codereview.adblockplus.org/5294633391226880/diff/5647308616105984/chrome/content/ui/ext/popup.js File chrome/content/ui/ext/popup.js ...
Oct. 17, 2014, 3:02 p.m. (2014-10-17 15:02:20 UTC) #11
saroyanm
On 2014/10/17 15:02:20, Thomas Greiner wrote: > Went through the whole code again and found ...
Oct. 17, 2014, 6:32 p.m. (2014-10-17 18:32:15 UTC) #12
saroyanm
@Thomas please have a look when you have time. http://codereview.adblockplus.org/5294633391226880/diff/5647308616105984/chrome/content/ui/overlay.xul File chrome/content/ui/overlay.xul (right): http://codereview.adblockplus.org/5294633391226880/diff/5647308616105984/chrome/content/ui/overlay.xul#newcode53 chrome/content/ui/overlay.xul:53: ...
Oct. 21, 2014, 1:39 p.m. (2014-10-21 13:39:20 UTC) #13
Thomas Greiner
LGTM I added some information to my destructuring assignment comment for others to understand why ...
Oct. 21, 2014, 4:28 p.m. (2014-10-21 16:28:05 UTC) #14
saroyanm
On 2014/10/21 16:28:05, Thomas Greiner wrote: > I added some information to my destructuring assignment ...
Oct. 21, 2014, 5:15 p.m. (2014-10-21 17:15:55 UTC) #15
Wladimir Palant
http://codereview.adblockplus.org/5294633391226880/diff/5635415851663360/chrome/content/ui/ext/common.js File chrome/content/ui/ext/common.js (right): http://codereview.adblockplus.org/5294633391226880/diff/5635415851663360/chrome/content/ui/ext/common.js#newcode70 chrome/content/ui/ext/common.js:70: } Why is this a closure returning the require() ...
Oct. 23, 2014, 9:57 p.m. (2014-10-23 21:57:40 UTC) #16
saroyanm
Oct. 27, 2014, 9:49 p.m. (2014-10-27 21:49:20 UTC) #17
@Wladimir thanks for finding time and reviewing changes,
will really appreciate if you can also comment under my last comments. After
this review things will go more smoothly.

http://codereview.adblockplus.org/5294633391226880/diff/5635415851663360/chro...
File chrome/content/ui/ext/common.js (right):

http://codereview.adblockplus.org/5294633391226880/diff/5635415851663360/chro...
chrome/content/ui/ext/common.js:70: }
On 2014/10/23 21:57:40, Wladimir Palant wrote:
> Why is this a closure returning the require() function? Shouldn't it be:
> 
>    require: require
> 
> ?

Done.

http://codereview.adblockplus.org/5294633391226880/diff/5635415851663360/chro...
chrome/content/ui/ext/common.js:79: ext = {
On 2014/10/23 21:57:40, Wladimir Palant wrote:
> This is an undeclared variable. Please do it like this:
> 
> var ext = function()
> {
>   ...
>   return {
>     ...
>   };
> };

I've declared ext in Utils and left a comment there.

http://codereview.adblockplus.org/5294633391226880/diff/5635415851663360/chro...
chrome/content/ui/ext/common.js:98: return (args ?
stringBundle.formatStringFromName(key, args, args.length) :
stringBundle.GetStringFromName(key));
On 2014/10/23 21:57:40, Wladimir Palant wrote:
> Please don't use stringBundle.formatStringFromName(), we don't use that
> placeholder format - it doesn't allow changing order of placeholders in
> translated strings. If anything, we should use ?1? and ?2? for placeholders
> (that's what we normally use in Firefox). We will need Chrome/Opera/Safari
> changes however if any shared strings use these placeholders.

Done, please let me know if I'm missing something.

http://codereview.adblockplus.org/5294633391226880/diff/5635415851663360/chro...
chrome/content/ui/ext/common.js:117: callback([new Page(tab)]);
On 2014/10/23 21:57:40, Wladimir Palant wrote:
> Is the Page class used anywhere else? If not, then the following should be
> sufficient:
> 
> callback([{
>   url: location.spec,
>   sendMessage: (message, responseCallback) => responseCallback()
> }]);
> 
> No need for a tab object and a Page class.

Done.

http://codereview.adblockplus.org/5294633391226880/diff/5635415851663360/chro...
File chrome/content/ui/ext/popup.js (right):

http://codereview.adblockplus.org/5294633391226880/diff/5635415851663360/chro...
chrome/content/ui/ext/popup.js:26: var topWindow =
iframe.ownerDocument.defaultView;
On 2014/10/23 21:57:40, Wladimir Palant wrote:
> Please add a variable |panel = iframe.parentNode| - currently it's unclear
what
> this refers to.

Done.

http://codereview.adblockplus.org/5294633391226880/diff/5635415851663360/chro...
chrome/content/ui/ext/popup.js:43: resizingScheduled = false;
On 2014/10/23 21:57:40, Wladimir Palant wrote:
> Please move that line to the top of the function - if any other code in this
> function throws an exception we shouldn't end up in an invalid state.

Done.

http://codereview.adblockplus.org/5294633391226880/diff/5635415851663360/chro...
chrome/content/ui/ext/popup.js:59: ext = {
On 2014/10/23 21:57:40, Wladimir Palant wrote:
> Again, please don't assign to undeclared variables.

the ext from common.js should be accessible here I guess, I've declared ext in
utils.js and left a comment there.

http://codereview.adblockplus.org/5294633391226880/diff/5635415851663360/chro...
File chrome/content/ui/i18n.js (left):

http://codereview.adblockplus.org/5294633391226880/diff/5635415851663360/chro...
chrome/content/ui/i18n.js:48: var placeholders = message.placeholders;
@Wladimir Why did we used this placeholder ?
Seems like it always was null ?

http://codereview.adblockplus.org/5294633391226880/diff/5635415851663360/chro...
chrome/content/ui/i18n.js:67: text = text.split("$" + key +
"$").join(replacement);
@Wladimir why we used this approach ?

http://codereview.adblockplus.org/5294633391226880/diff/5635415851663360/chro...
File chrome/content/ui/popup.html (right):

http://codereview.adblockplus.org/5294633391226880/diff/5635415851663360/chro...
chrome/content/ui/popup.html:59: </li>
On 2014/10/23 21:57:40, Wladimir Palant wrote:
> The idea is that this file will be shared between Firefox and Chrome. So,
where
> did (currently) Chrome-specific functionality go, like the hit counter?

Mentioned functionality will be added with relevant ticket, I was thinking not
to overload this review. Finally this file will have only small changes that we
will need to backport to Chrome.

http://codereview.adblockplus.org/5294633391226880/diff/5635415851663360/chro...
File chrome/content/ui/popup.js (right):

http://codereview.adblockplus.org/5294633391226880/diff/5635415851663360/chro...
chrome/content/ui/popup.js:18: var backgroundPage =
ext.backgroundPage.getWindow();
On 2014/10/23 21:57:40, Wladimir Palant wrote:
> Can I just assume that this file has been moved from adblockpluschrome without
> any changes?

No, it's missing functionality that will be added by relevant tickets and also
this contains functionality, like open blockable items which is not implemented
in Chrome/Safari/Opera so the open blockable item block will be hidden there.

http://codereview.adblockplus.org/5294633391226880/diff/5635415851663360/chro...
File chrome/locale/en-US/popup.properties (right):

http://codereview.adblockplus.org/5294633391226880/diff/5635415851663360/chro...
chrome/locale/en-US/popup.properties:3: clickhide_instructions=After closing
this popup, click (or right-click) an element on the page.
On 2014/10/23 21:57:40, Wladimir Palant wrote:
> Please add a comment above explaining that this is Chrome-specific
functionality
> - otherwise the translators will be confused.

Done.

http://codereview.adblockplus.org/5294633391226880/diff/5635415851663360/chro...
chrome/locale/en-US/popup.properties:5: easy_create_filter=Block element
On 2014/10/23 21:57:40, Wladimir Palant wrote:
> Same here, this needs a comment.

Done.

http://codereview.adblockplus.org/5294633391226880/diff/5635415851663360/chro...
File chrome/skin/popup.css (right):

http://codereview.adblockplus.org/5294633391226880/diff/5635415851663360/chro...
chrome/skin/popup.css:18: body
On 2014/10/23 21:57:40, Wladimir Palant wrote:
> Can I assume that this file has been copied from Chrome without any changes?

Some rules are yet again missing which will be added during relevant ticket
reviews and also added rule for open blockable item.

http://codereview.adblockplus.org/5294633391226880/diff/5635415851663360/lib/...
File lib/ui.js (right):

http://codereview.adblockplus.org/5294633391226880/diff/5635415851663360/lib/...
lib/ui.js:389:
this.overlay["abp-toolbarbutton"].appendChild(fixId(menuSource.cloneNode(true),
"abp-toolbar"));
On 2014/10/23 21:57:40, Wladimir Palant wrote:
> Shouldn't this go away as well, along with the fixId() function?

In current review we are using abp-status-popup for showing panel during right
click when the default left click action is changed using customization addon
and abp-toolbar-popup, but in future we will change that behavior and use
openPopup method to show panel, both for left and right click, so with that
review this part shouldn't make that much confusion.

http://codereview.adblockplus.org/5294633391226880/diff/5635415851663360/lib/...
lib/ui.js:1299: let window = popup.ownerDocument.defaultView;
On 2014/10/23 21:57:40, Wladimir Palant wrote:
> How about defining the window variable before the |if| block and using it for
> the |else| case as well?

Oops.

http://codereview.adblockplus.org/5294633391226880/diff/5635415851663360/lib/...
lib/ui.js:1318: if (popup.id == "abp-toolbar-popup")
On 2014/10/23 21:57:40, Wladimir Palant wrote:
> What about abp-status-popup?

Yes this is wrong and also wrong while now we are using same id
(abp-toolbar-popup-browser) in two places (in popupset and toolbarbutton), but
this again will be changed with the review mentioned above.

http://codereview.adblockplus.org/5294633391226880/diff/5769928858664960/chro...
File chrome/content/ui/utils.js (right):

http://codereview.adblockplus.org/5294633391226880/diff/5769928858664960/chro...
chrome/content/ui/utils.js:50: var ext;
@Wladimir I'm not sure if we should use require function to return ext as a
module ? 
if (module == "ext")
  return ext;

Powered by Google App Engine
This is Rietveld