Closed Bug 1690750 Opened 3 years ago Closed 3 years ago

Limit OpenSearchEngine to allow only the protocols where users can load engines from

Categories

(Firefox :: Search, task, P3)

task
Points:
3

Tracking

()

RESOLVED FIXED
87 Branch
Iteration:
87.2 - Feb 8 - Feb 21
Tracking Status
firefox87 --- fixed

People

(Reporter: standard8, Assigned: standard8)

References

Details

Attachments

(1 file)

OpenSearchEngine currently allows loading from https, http, ftp, data, file, resource and chrome protocols.

However, LinkHandlerChild - the only place a user can currently install an OpenSearch engine - only allows https, http and ftp: https://searchfox.org/mozilla-central/rev/927e525f481a93a8f63d27a78ae6201e42b1b1fb/browser/actors/LinkHandlerChild.jsm#149

Reducing the list in OpenSearchEngine allows us to simplify the load path handling. Whilst here, we can also simplify the constructor and load functions. This should make understanding what is happening there much easier.

The side effect of this is that we must also change a lot of tests, since we can't load from chrome/file protocols, however I think that is a benefit as it makes the tests more realistic, and makes it more obvious what needs to be changed in the future if we want to move away from using OpenSearch engines in the majority of tests.

The urls where an OpenSearch engine can be loaded from are already limited in LinkHandlerChild. This is cleaning up and simplifying what the OpenSearchEngine allows, and as a result allows the load path handling to be greatly simplified.

The test changes are due to no longer allowing chrome or file protocols. For future, we probably want to move away from OpenSearch for most of these, but the changes will make it easier to find the places to update.

Iteration: 87.1 - Jan 25 - Feb 7 → 87.2 - Feb 8 - Feb 21
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/63167d041bb4
Simplify OpenSearchEngine to only allow loading engines from protocols where users can load them from. r=mak
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch
Regressions: 1718411
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: