bypassCache propertie should not be ignored for an discarded tab when using tabs.reload
Categories
(WebExtensions :: General, defect, P5)
Tracking
(firefox57 wontfix)
Tracking | Status | |
---|---|---|
firefox57 | --- | wontfix |
People
(Reporter: kernp25, Assigned: kernp25)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
(deleted),
patch
|
u462496
:
feedback-
|
Details | Diff | Splinter Review |
(deleted),
text/x-phabricator-request
|
Details |
Updated•7 years ago
|
Updated•7 years ago
|
Comment 3•7 years ago
|
||
Assignee | ||
Comment 10•7 years ago
|
||
Assignee | ||
Comment 11•7 years ago
|
||
Comment 12•7 years ago
|
||
Assignee | ||
Comment 13•7 years ago
|
||
Updated•6 years ago
|
Comment 15•5 years ago
|
||
str |
The original bug report did not have enough detail to allow people who are unfamiliar with extensions to reproduce the problem. Here are the minimal steps-to-reproduce:
Minimal STR:
- Install https://addons.mozilla.org/en-US/firefox/addon/discard-tab/
- Start a simple server to see if requests are being handled, e.g.
python -m http.server 8080
or (if using Python 2)python -m SimpleHTTPServer 8080
- Visit http://localhost:8080/
- Switch to a different tab.
- Right-click on the tab from step 3 and click on "Discard Tab"
- Inspect the background page of that add-on (via
about:debugging
) to get access to a place to run extension code. - Get the tabId for the tab from step 3, e.g.
tabId = await browser.tabs.query({url: "http://localhost:8080/*"})[0]
- Reload the tab:
browser.tabs.reload(tabId, {bypassCache:true})
- Look at the console from step 2.
Expected:
- Two requests with
GET /
(i.e. the one from step 3 and from step 8)
Actual:
- Only one request with
GET /
(from step 3; step 8 is missing)
Comment 16•5 years ago
|
||
(In reply to kernp25 from comment #14)
Can this be implemented?
I see that you've proposed a patch three years ago. Could you look at the current code and propose a patch? I'll guide you through the development of a proper bugfix.
From a quick look, I see that the reload logic is here: https://searchfox.org/mozilla-central/rev/dc4560dcaafd79375b9411fdbbaaebb0a59a93ac/browser/base/content/tabbrowser.js#2189-2203
There is an attempt to restore the tab before passing on the reloadWithFlags
call. I would expect the reload to be interpreted as a fresh reload when reloadWithFlags(Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE)
is used. I suggest to look in that direction - what can you do to avoid the initial restore and skip straight ahead to loading the content anew.
Assignee | ||
Comment 17•5 years ago
|
||
(In reply to Rob Wu [:robwu] from comment #16)
I see that you've proposed a patch three years ago. Could you look at the current code and propose a patch? I'll guide you through the development of a proper bugfix.
I will try. Is there a meta bug or something that can link to this bug?
So other people will find this bug and maybe also want to start working on this?
Assignee | ||
Comment 18•5 years ago
|
||
Assignee | ||
Comment 19•5 years ago
|
||
The current behavior is a bug. Because the bypassCache
property will be completely ignored for an discarded tab.
Comment 20•5 years ago
|
||
(In reply to kernp25 from comment #17)
I will try. Is there a meta bug or something that can link to this bug?
So other people will find this bug and maybe also want to start working on this?
There's generally no need to link bugs for more visibility. All it does is causing more emails to be sent.
Bug 1462813 does however look like a good meta bug to link to, in case subscribers are interested in this bug.
(In reply to kernp25 from comment #19)
The current behavior is a bug. Because the
bypassCache
property will be completely ignored for an discarded tab.
That's clear. Reproduction steps are in comment 15.
Assignee | ||
Comment 21•5 years ago
|
||
You worked on https://bugzilla.mozilla.org/show_bug.cgi?id=675539
Maybe you can fix this bug?
Assignee | ||
Comment 22•5 years ago
|
||
The code in the patch is from my old xul addon.
Assignee | ||
Comment 23•5 years ago
|
||
Most of the code, that needs to be changed, is in ContentRestore.jsm.
Maybe you can fix this bug or find someone, who can?
In my old xul add-on i was doing this, to bypass the cache from a discarded tab:
history.QueryInterface(Ci.nsIWebNavigation).reload(reloadFlags);
I don't know, if this still works to.
Comment 24•5 years ago
|
||
I am not familiar with the internal mechanisms used to restore tabs unfortunately, sorry.
Comment 25•5 years ago
|
||
I'm afraid I don't currently have the cycles to look at this. Perhaps someone on the WebExtension team might, though.
Comment 26•5 years ago
|
||
This is a P5 bug, which means that it is not a high priority for the WebExtensions team, compared to the work on th lot of other bugs/features that we have.
If you feel that this is a high priority, then you are welcome to submit a patch. As said before, I am willing to provide mentorship on resolving this bug. There is a guide for contributing code to the WebExtensons API implementation at https://wiki.mozilla.org/WebExtensions/Contribution_Onramp
Assignee | ||
Comment 27•3 years ago
|
||
(In reply to Rob Wu [:robwu] from comment #16)
From a quick look, I see that the reload logic is here: https://searchfox.org/mozilla-central/rev/dc4560dcaafd79375b9411fdbbaaebb0a59a93ac/browser/base/content/tabbrowser.js#2189-2203
There is an attempt to restore the tab before passing on the
reloadWithFlags
call. I would expect the reload to be interpreted as a fresh reload whenreloadWithFlags(Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE)
is used. I suggest to look in that direction - what can you do to avoid the initial restore and skip straight ahead to loading the content anew.
I have looked at it again and my idea would be:
To add back the reloadFlags that where removed in Bug 1534638.
So we can use the flags in restoreTabContent, to decide, if the load should bypass the cache.
What do you think?
If yes, a new bug should be created to re-add the reloadFlags?
Comment 28•3 years ago
|
||
I don't see much value in a new bug about adding something if there is no concrete gain from making the change.
If you think that making the change fixes this issue, submit a patch with a unit test. If the patch looks fine, doesn't cause regressions and the new test passes (while the test failed before the fix), then we can land the patch and mark this bug as resolved.
Assignee | ||
Comment 29•3 years ago
|
||
Updated•3 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Description
•