Closed
Bug 603674
Opened 14 years ago
Closed 14 years ago
User-modifiable preference for base URL of snippets service in about:home
Categories
(Firefox :: General, defect)
Firefox
General
Tracking
()
RESOLVED
FIXED
Firefox 4.0b8
Tracking | Status | |
---|---|---|
blocking2.0 | --- | final+ |
People
(Reporter: lorchard, Assigned: mak)
References
Details
(Whiteboard: [about-home])
Attachments
(1 file, 3 obsolete files)
(deleted),
patch
|
Gavin
:
review+
|
Details | Diff | Splinter Review |
The base URL for the snippets service used by about:home is currently hardcoded to "http://snippets.mozilla.com"
It would be better for webdev and QA if this base URL could be modified in about:config. (eg. expected values could include things like "http://localhost:8000" and "http://homesnippets.stage.mozilla.com")
Since the current code looks at localStorage['snippets-update-url'], changes to the base URL in about:config would also require a rebuild of the whole URL to replace the localStorage version
Reporter | ||
Comment 2•14 years ago
|
||
For what it's worth, I just figured a workaround for this. I can use a bookmarklet like this on about:home:
javascript:void(localStorage['snippets-update-url-orig']=localStorage['snippets-update-url'];localStorage['snippets-update-url']='http://localhost:8000/1/Firefox/4.0b8pre/20101010030401/Darwin_Universal-gcc3/en-US/nightly/Darwin 10.4.0/default/default/')
And then something like this to restore the original value:
javascript:void(localStorage['snippets-update-url']=localStorage['snippets-update-url-orig']);
Of course this is pretty hacky, and can leave the snippets update URL in a bad state, but it could be a workaround if there's not time to implement a more robust about:config based solution
Assignee | ||
Comment 3•14 years ago
|
||
Another problem with the pref stuff is that it could have an unwanted impact on startup. Undeed, right now we just update on each build change (so daily for nightlies, but less often for other releases). We would have to load and update the value on each start, plus add a pref listener.
Maybe I could just read the value from the pref on upgrade, to force an upgrade it would be enough to fake a build update clearing browser.startup.homepage_override.buildID value and restarting browser.
Assignee | ||
Comment 4•14 years ago
|
||
this does the above, updating the url from the pref at each new build.
Actually the bookmarklet made me drop completely my faith in security of hardcoding the url. Indeed we should probably add a check somewhere that the url points to a mozilla valid host. What do you think Gavin?
Attachment #482836 -
Flags: review?(gavin.sharp)
Assignee | ||
Comment 5•14 years ago
|
||
how did that period finish there!? bah.
Attachment #482836 -
Attachment is obsolete: true
Attachment #482838 -
Flags: review?(gavin.sharp)
Attachment #482836 -
Flags: review?(gavin.sharp)
Reporter | ||
Comment 6•14 years ago
|
||
(In reply to comment #4)
> Indeed we should probably add a check somewhere that the
> url points to a mozilla valid host. What do you think Gavin?
FWIW, requiring that the URL points to a Mozilla host would keep me from using my laptop (http://localhost:8000/) or my public server demo (http://snippets.decafbad.com/) - which is the reason I filed this in the first place.
It would hopefully let us use a Mozilla staging server like http://snippets.stage.mozilla.com/, but I'm not sure what any hardcoded restriction buys overall
Assignee | ||
Updated•14 years ago
|
Whiteboard: [needs review gavin]
Comment 7•14 years ago
|
||
Perhaps we should add code in the startup path that calls AboutHomeUtils.loadSnippetsURL if this pref has a user value, so that changing it just requires a restart, without having to reset the buildID pref too?
I don't think we need to put any restrictions on the value.
Assignee | ||
Comment 8•14 years ago
|
||
this makes so that we update the entry if either there is an override or the pref has a user value.
Also replaces some GetService with Services since we already imported Services.jsm in the file. I triple checked each change and will most likely do another pass.
Attachment #482838 -
Attachment is obsolete: true
Attachment #485840 -
Flags: review?(gavin.sharp)
Attachment #482838 -
Flags: review?(gavin.sharp)
Assignee | ||
Comment 9•14 years ago
|
||
I've done another pass checking changes line by line, and created a new profile, everything looks in place.
Comment 10•14 years ago
|
||
Comment on attachment 485840 [details] [diff] [review]
patch v1.2
Sorry to be mean, but can you move the Services.jsm-related cleanup to a followup (minus the addition of urlFormatter, that part can stay) that we can ignore until post-4.0? I'd really rather not do it now.
Updated•14 years ago
|
Attachment #485840 -
Flags: review?(gavin.sharp)
Assignee | ||
Comment 11•14 years ago
|
||
minimum changes.
Attachment #485840 -
Attachment is obsolete: true
Attachment #487894 -
Flags: review?(gavin.sharp)
Updated•14 years ago
|
Attachment #487894 -
Flags: review?(gavin.sharp) → review+
Assignee | ||
Comment 12•14 years ago
|
||
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•14 years ago
|
Target Milestone: --- → Firefox 4.0b8
Assignee | ||
Updated•14 years ago
|
Whiteboard: [needs review gavin]
Assignee | ||
Updated•14 years ago
|
Whiteboard: [about-home]
You need to log in
before you can comment on or make changes to this bug.
Description
•