Closed Bug 1780581 Opened 3 years ago Closed 8 months ago

consider helper function to identify moz-extension scheme urls

Categories

(WebExtensions :: General, enhancement, P5)

enhancement

Tracking

(firefox143 fixed)

RESOLVED FIXED
143 Branch
Tracking Status
firefox143 --- fixed

People

(Reporter: mixedpuppy, Assigned: chrstina.lin, NeedInfo)

References

Details

(Whiteboard: [addons-jira])

Attachments

(1 file)

To replace url.startsWith("moz-extension://"), perhaps ExtensionUtils.isExtensionUrl(url)

Severity: -- → N/A
Priority: -- → P5
Keywords: good-first-bug
Mentor: wdurand

What`s with favIconUrl.startsWith("blob:") and other protocols?

Flags: needinfo?(rob)

(In reply to kernp25 from comment #2)

What`s with favIconUrl.startsWith("blob:") and other protocols?

blob:-URLs may be generated internally for built-in search engines. In the source code you linked, blob:-URLs are converted to data:-URLs because extensions would otherwise encounter a URL that they cannot load. The context for that is in a regression that you reported before (bug 1918386) that we fixed.

Flags: needinfo?(rob)

I mean, should the helper function also work for blob: and other protocols?

Or just moz-extension:?

Maybe isUrlScheme(url)?

Flags: needinfo?(rob)

Maybe isUrlScheme(url)?

Should be isUrlScheme(url, "blob")

(In reply to kernp25 from comment #4)

I mean, should the helper function also work for blob: and other protocols?

Or just moz-extension:?

Just moz-extension:.

Note that the implementation that calls .startWith("moz-extension://") assumes that the URL is already normalized. In situations where a nsIURI or (standard) URL is available, .schemeIs("moz-extension") and .protocol === "moz-extension:" can already be used instead, with clarity.

A search query showing some current uses of "moz-extension: in JS is at https://searchfox.org/mozilla-central/search?q=%22moz-extension%3A&path=.*js&case=false&regexp=false

Flags: needinfo?(rob)
Assignee: nobody → chrlin
Status: NEW → ASSIGNED
Keywords: good-first-bug
Whiteboard: [addons-jira]
Pushed by tjovanovic@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/a3183b8c2fe9 https://hg.mozilla.org/integration/autoland/rev/10b16a392a14 Add isExtensionUrl Helper Function. r=zombie,geckoview-reviewers,settings-reviewers,devtools-reviewers,omc-reviewers,home-newtab-reviewers,urlbar-reviewers,Standard8,pdahiya,bomsy,mconley
Pushed by pstanciu@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/b200209e9111 https://hg.mozilla.org/integration/autoland/rev/bc47b67617b4 Revert "Bug 1780581 - Add isExtensionUrl Helper Function. r=zombie,geckoview-reviewers,settings-reviewers,devtools-reviewers,omc-reviewers,home-newtab-reviewers,urlbar-reviewers,Standard8,pdahiya,bomsy,mconley" for causing DT failures @browser_dbg-javascript-tracer-worker.js

Backed out for causing DT failures @browser_dbg-javascript-tracer-worker.js

Flags: needinfo?(chrlin)
Pushed by tjovanovic@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/a84124f52f32 https://hg.mozilla.org/integration/autoland/rev/42aab21bf427 Add isExtensionUrl Helper Function. r=zombie,geckoview-reviewers,settings-reviewers,devtools-reviewers,omc-reviewers,home-newtab-reviewers,urlbar-reviewers,Standard8,pdahiya,bomsy,mconley
Pushed by sstanca@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/268b6a1b89e7 https://hg.mozilla.org/integration/autoland/rev/10a03896c9ac Revert "Bug 1780581 - Add isExtensionUrl Helper Function. r=zombie,geckoview-reviewers,settings-reviewers,devtools-reviewers,omc-reviewers,home-newtab-reviewers,urlbar-reviewers,Standard8,pdahiya,bomsy,mconley" for causing mochitests-plain failures in test_ext_idle.html.

Reverted this because it was causing mochitests-plain failures in test_ext_idle.html.

  • Revert link
  • Push with failures
  • Failure Log
  • Failure line: TEST-UNEXPECTED-FAIL | toolkit/components/extensions/test/mochitest/test_ext_idle.html | Idle status is active - Expected: active, Actual: idle
Mentor: wdurand

The above backout was unrelated to the patch here; I fixed the intermittent failures of test_ext_idle.html in bug 1947300.

The patch needs to be re-uploaded (to work around https://bugzilla.mozilla.org/show_bug.cgi?id=1963406#c6 ), but other than that it should be ready to land.

Pushed by tjovanovic@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/d64188064b9b https://hg.mozilla.org/integration/autoland/rev/bb3bcfc6bd5e Add isExtensionUrl Helper Function. r=zombie,geckoview-reviewers,settings-reviewers,devtools-reviewers,omc-reviewers,home-newtab-reviewers,urlbar-reviewers,Standard8,pdahiya,bomsy,mconley
Status: ASSIGNED → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 143 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: