Add button to invalidate startup cache in about:support
Categories
(Toolkit :: General, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox79 | --- | fixed |
People
(Reporter: flod, Assigned: priyanksingh8, Mentored)
References
Details
(Keywords: good-first-bug)
Attachments
(1 file)
Currently it's possible to run Firefox executable with -purgecaches
, but there's no way to clear that cache from Firefox itself.
Command line options are not easy to discover for most users, and Safe Mode is just too scary.
We have cases where purging caches helps users (e.g. bug 1564998, bug 1520446). It would be nice to have that capability in about:support, at least as a stopgap solution.
Updated•6 years ago
|
Comment 1•6 years ago
|
||
This looks to be trivial. Just need to add a button that calls Services.appinfo.invalidateCachesOnRestart()
.
Comment 2•6 years ago
|
||
Dave, are you interested into mentoring this bug? it sounds like it could be a good-first-bug.
Comment 3•6 years ago
|
||
Yeah ok
Comment 4•6 years ago
|
||
Hi there, I am a final year computer science student from the University of Toronto. I am interested in this bug. Can I work on this?
Comment 5•6 years ago
|
||
Sorry for the delay, was sick for a few days last week. By all means please take a look.
The source code for about:support is here:
https://searchfox.org/mozilla-central/source/toolkit/content/aboutSupport.xhtml
https://searchfox.org/mozilla-central/source/toolkit/content/aboutSupport.js
Basically we want something like the safe mode restart button but restarts normally and calls the function in comment 1 first.
Comment 6•6 years ago
|
||
thank you very much. I will start to work shortly
Comment 7•6 years ago
|
||
Hi Dave, about:support is a relatively large page. Where do you want the button be?
Comment 8•6 years ago
|
||
I think right below the safe mode button should work.
Flod, do you have thoughts on wording here? Maybe something like:
Try clearing the Firefox cache
[Clear Firefox cache]
And then on click show a dialog:
Clear Firefox cache
This requires restarting Firefox. No settings will be lost.
[Cancel] [Restart]
Reporter | ||
Comment 9•6 years ago
|
||
Yes, I was invisioning pretty much the same.
A couple of question:
- Should we have ask UX to provide the copy for this?
- Is "Firefox Cache" potentially confusing? I assumed this would remove only the UI cache. If we're removing all caches, including the navigation cache, then it's definitely OK.
Comment 10•6 years ago
|
||
(In reply to Francesco Lodolo [:flod] from comment #9)
Yes, I was invisioning pretty much the same.
A couple of question:
- Should we have ask UX to provide the copy for this?
Yeah let's see if they have thoughts.
- Is "Firefox Cache" potentially confusing? I assumed this would remove only the UI cache. If we're removing all caches, including the navigation cache, then it's definitely OK.
It is! But I was struggling to think of anything better. UI cache sounds good though.
Comment 11•6 years ago
|
||
(In reply to Dave Townsend [:mossop] (he/him) from comment #10)
(In reply to Francesco Lodolo [:flod] from comment #9)
Yes, I was invisioning pretty much the same.
A couple of question:
- Should we have ask UX to provide the copy for this?
Yeah let's see if they have thoughts.
- Is "Firefox Cache" potentially confusing? I assumed this would remove only the UI cache. If we're removing all caches, including the navigation cache, then it's definitely OK.
It is! But I was struggling to think of anything better. UI cache sounds good though.
Does "It is!" refer to Firefox Cache being confusing or to removing all caches vs the UI cache?
Comment 12•6 years ago
|
||
(In reply to mheubusch from comment #11)
(In reply to Dave Townsend [:mossop] (he/him) from comment #10)
(In reply to Francesco Lodolo [:flod] from comment #9)
Yes, I was invisioning pretty much the same.
A couple of question:
- Should we have ask UX to provide the copy for this?
Yeah let's see if they have thoughts.
- Is "Firefox Cache" potentially confusing? I assumed this would remove only the UI cache. If we're removing all caches, including the navigation cache, then it's definitely OK.
It is! But I was struggling to think of anything better. UI cache sounds good though.
Does "It is!" refer to Firefox Cache being confusing or to removing all caches vs the UI cache?
"Firefox Cache" because there are multiple caches and I was only imagining clearing the startup cache. There is nothing to stop us clearing the network cache too though.
Comment 13•6 years ago
|
||
If only startup cache is cleared, I recommend:
Try clearing the start up cache
[Clear start up cache . . .]
And then on click show a dialog:
Clear startup cache
Restart <shortname> to clear startup cache. This will not change your settings or remove extensions you’ve added to <shortname>.
[Cancel] [Restart]
Comment 14•6 years ago
|
||
Fyi -<shortname> is the parameter for the version - Firefox, Nightly, Beta - but I forgot how to notate that.
Comment 15•6 years ago
|
||
Joni - FYI that this new feature is being added to about:support - in a perfect world I would rework the entire box and how we advise users on the severity of these different actions and link to an article in SUMO - but NI'ing you in case you might still want to add info about this to SUMO in the meantime. Cheers!
Comment hidden (off-topic) |
Comment 17•6 years ago
|
||
I will follow the format:
Try clearing the start up cache
[Clear start up cache . . .]
And then on click show a dialog:
Clear startup cache
Restart <shortname> to clear startup cache. This will not change your settings or remove extensions you’ve added to <shortname>.
[Cancel] [Restart]
Reporter | ||
Comment 18•6 years ago
|
||
I assume we should use startup consistently, and that "start up" is incorrect in the first two sentences (hopefully Michelle will correct if that's wrong).
Reporter | ||
Comment 19•5 years ago
|
||
Stumbled upon another Reddit post with half-translated Firefox. Any chance we can prioritize this?
Comment 20•5 years ago
|
||
Hi Dave, Can I take up this issue?
Thanks :)
Aarushi
Reporter | ||
Comment 22•5 years ago
|
||
@aarushivij
Are you still working on this bug?
Reporter | ||
Comment 23•5 years ago
|
||
Reassigning for lack of replies. Also clearing NI for Joni in the meantime.
Assignee | ||
Comment 24•5 years ago
|
||
Would like to take up this issue.
Reporter | ||
Comment 25•5 years ago
|
||
Not really the right person (see the Mentor field), but feel free to work on this ;-)
Assignee | ||
Comment 26•5 years ago
|
||
Hi Dave, could you guide me through the process as what results are we expecting as I it is unclear from look at previous comments.
Comment 27•5 years ago
|
||
In about:support there are two buttons at the top, "Refresh Firefox" and "Restart with Add-ons Disabled".
We want to add a third button there as specified in comment 13. The code to show the dialog should be similar to that here: https://searchfox.org/mozilla-central/rev/9aa7bebfd169bc2ead00ef596498a406e56bbb85/browser/components/BrowserGlue.jsm#1364 except the restart should be a normal one and not into safe mode and before restarting we should call Services.appinfo.invalidateCachesOnRestart()
.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 28•5 years ago
|
||
I am quite unclear as how to show dialog, maybe Services.prompt.confirmEx
function does the job and I am unable to understand
how gBrowserBundle
is used in https://searchfox.org/mozilla-central/rev/9aa7bebfd169bc2ead00ef596498a406e56bbb85/browser/components/BrowserGlue.jsm#1366. Also where could I find implementation of Services.jsm
so that I may get idea about methods used in it.
Comment 29•5 years ago
|
||
(In reply to Priyank Singh from comment #28)
I am quite unclear as how to show dialog, maybe
Services.prompt.confirmEx
function does the job and I am unable to understand
howgBrowserBundle
is used in https://searchfox.org/mozilla-central/rev/9aa7bebfd169bc2ead00ef596498a406e56bbb85/browser/components/BrowserGlue.jsm#1366. Also where could I find implementation ofServices.jsm
so that I may get idea about methods used in it.
gBrowserBundle is a string bundle object. Though now I think about it we will need to use fluent to do the localization here instead. document.l10n.formatValue
or document.l10n.formatValues
are asynchronous methods that will get you strings out of the localization files. There are some examples of its use in aboutSupport.js
.
Services.jsm is implemented here but is probably not of interest here, it just exposes a bunch of services that are implemented elsewhere. In this case you want the implementation of Services.prompt which is an XPCOM object that implements the nsIPromptService interface.
Assignee | ||
Comment 30•5 years ago
|
||
(In reply to mheubusch from comment #14)
Fyi -<shortname> is the parameter for the version - Firefox, Nightly, Beta - but I forgot how to notate that.
How to use <shortname> here?
Also what function do I have to call to restart firefox?
Comment 31•5 years ago
|
||
(In reply to Priyank Singh from comment #30)
(In reply to mheubusch from comment #14)
Fyi -<shortname> is the parameter for the version - Firefox, Nightly, Beta - but I forgot how to notate that.
How to use <shortname> here?
You use { -brand-short-name }
in the string.
Also what function do I have to call to restart firefox?
You will want to use Services.startup.quit
Assignee | ||
Comment 32•5 years ago
|
||
I could see that I have to pass Ci.nsIAppStartup.eRestart
as a variable to restart, what is Ci
here?
Assignee | ||
Comment 33•5 years ago
|
||
Also how { -brand-short-name }
is evaluated?
The reason I am asking so many questions is I need to get proper understanding how the code is working for a first timer, I could have pasted the code from docs but I don't want to :)
Assignee | ||
Comment 34•5 years ago
|
||
Comment 35•5 years ago
|
||
(In reply to Priyank Singh from comment #32)
I could see that I have to pass
Ci.nsIAppStartup.eRestart
as a variable to restart, what isCi
here?
It is the Components.interfaces
object.
(In reply to Priyank Singh from comment #33)
Also how
{ -brand-short-name }
is evaluated?The reason I am asking so many questions is I need to get proper understanding how the code is working for a first timer, I could have pasted the code from docs but I don't want to :)
It includes another localized string in the result, in this case this one: https://searchfox.org/mozilla-central/rev/d9d492eda787a6eda66016e6f8398ee759f7bc25/browser/branding/nightly/locales/en-US/brand.ftl#16
Assignee | ||
Comment 36•5 years ago
|
||
I pushed the patch, could you review it?
Comment 37•5 years ago
|
||
The review request in phabricator is enough, no need to needinfo me as well.
Comment 38•5 years ago
|
||
Has the patch been through any try runs (I don't know if you have access or not)?
Assignee | ||
Comment 39•5 years ago
|
||
No, I haven't used treeherder before, however I have level 1 access. When I tried running ./mach try empty
I am getting error has Permission denied (public key)
here is the paste bin. Does it require some configuration before running or what, also I think push-to-try and firefoxtree extensions are enabled.
Assignee | ||
Comment 40•5 years ago
|
||
Mercurial access for my account was disabled, filed a bug for the same.
https://bugzilla.mozilla.org/show_bug.cgi?id=1642574
Updated•5 years ago
|
Assignee | ||
Comment 41•5 years ago
|
||
I think we must mark this as resolved or is the bug still open?
Reporter | ||
Comment 42•5 years ago
|
||
This bug is still open, the patch didn't land yet. As far as I can tell, Dave is waiting for a try push.
P.S. Once again, not the mentor for this bug ;-)
Comment 43•5 years ago
|
||
Yes I'd like to see it go through at least the lint checks on try before I push it to central. Looks like your account is restored but if you're still having problems let me know and I'll do it.
Assignee | ||
Comment 45•5 years ago
|
||
I have pushed my patch to try [here] lint checks are passed.(https://treeherder.mozilla.org/#/jobs?repo=try&revision=79bcf50fed05aca3a5c7562b54052bd931edd886)
But I am unable to trigger new jobs in treeherder, filed a bug regarding the taskcluster issue. Won't be able to trigger jobs until the issue is resolved, also I was unable to determine which jobs to among so many jobs. Could you do that for me if any job is required to be triggered for this patch to be tested.
Comment 46•5 years ago
|
||
I think the lint jobs are all that are needed here. Unfortunately about:support doesn't have great tests.
Comment 47•5 years ago
|
||
Comment 48•5 years ago
|
||
bugherder |
Comment 49•5 years ago
|
||
Thanks for the patch!
Comment 50•5 years ago
|
||
(In reply to mheubusch from comment #15)
Joni - FYI that this new feature is being added to about:support - in a perfect world I would rework the entire box and how we advise users on the severity of these different actions and link to an article in SUMO - but NI'ing you in case you might still want to add info about this to SUMO in the meantime. Cheers!
(In reply to Francesco Lodolo [:flod] from comment #23)
Reassigning for lack of replies. Also clearing NI for Joni in the meantime.
Adding back Need-Info for Joni, in case a new SUMO article is needed.
I also set up a Needs Change entry for the https://support.mozilla.org/en-US/kb/use-troubleshooting-information-page-fix-firefox article.
Updated•5 years ago
|
Comment 51•5 years ago
|
||
I added a new Try clearing the startup cache section to the https://support.mozilla.org/en-US/kb/use-troubleshooting-information-page-fix-firefox article for fx79.
Description
•