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

Issue 29532763: Issue 5593 - Wait for prefs before updating popup UI (Closed)

Created:
Aug. 31, 2017, 3:49 p.m. by Manish Jethani
Modified:
Sept. 1, 2017, 10:28 a.m.
CC:
Wladimir Palant
Base URL:
https://hg.adblockplus.org/adblockpluschrome/
Visibility:
Public.

Description

Issue 5593 - Wait for prefs before updating popup UI This is part of the work to move away from overwriting the window.ext of the background page and the popup having its own window.ext. We'll still need a minimal lib/adblockplus.js in the popup. At the very least, we'll need the Prefs object (lib/prefs.js). We can do this by updating metadata.chrome. If we do that, the prefs aren't yet loaded when the onLoad handler is called. We need to wait for the prefs to be loaded. Once they're loaded, we can update the UI. The delay in loading is not visible to the human eye, but it's slow enough that the onLoad handler will get the default value rather than the actual value that was previously set.

Patch Set 1 #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -11 lines) Patch
M popup.html View 1 chunk +1 line, -1 line 2 comments Download
M popup.js View 2 chunks +13 lines, -10 lines 6 comments Download

Messages

Total messages: 5
Manish Jethani
Aug. 31, 2017, 3:49 p.m. (2017-08-31 15:49:56 UTC) #1
Manish Jethani
Patch Set 1 Please see the description. https://codereview.adblockplus.org/29532763/diff/29532764/popup.html File popup.html (right): https://codereview.adblockplus.org/29532763/diff/29532764/popup.html#newcode73 popup.html:73: <li id="stats-container" ...
Aug. 31, 2017, 3:56 p.m. (2017-08-31 15:56:57 UTC) #2
Thomas Greiner
LGTM Just a typo and an optional enhancement. https://codereview.adblockplus.org/29532763/diff/29532764/popup.html File popup.html (right): https://codereview.adblockplus.org/29532763/diff/29532764/popup.html#newcode73 popup.html:73: <li ...
Aug. 31, 2017, 4:39 p.m. (2017-08-31 16:39:09 UTC) #3
Sebastian Noack
NOT LGTM. I don't think that we should include lib/prefs.js in the popup, but rather ...
Aug. 31, 2017, 6:05 p.m. (2017-08-31 18:05:46 UTC) #4
Manish Jethani
Sept. 1, 2017, 10:27 a.m. (2017-09-01 10:27:57 UTC) #5
On 2017/08/31 18:05:46, Sebastian Noack wrote:
> NOT LGTM. I don't think that we should include lib/prefs.js in the popup, but
> rather use messaging, in the same fashion the options page does.

Agreed, this is not necessary.

Powered by Google App Engine
This is Rietveld