Closed Bug 1208763 Opened 5 years ago Closed 4 years ago

Treat chrome-extension:// and moz-extension:// schemes as equivalent

Categories

(WebExtensions :: General, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: callahad, Unassigned)

References

Details

(Keywords: DevAdvocacy, Whiteboard: [i18n]triaged[DevRel:P3][design-decision-needed])

The docs for chrome.i18n, https://developer.chrome.com/extensions/i18n, encourage constructing resource URIs by prepending "chrome-extension://" to the value of @@extension_id.

Despite supporting @@extension_id, we only recognize the moz-extension:// scheme. We should tread chrome-extension:// as an alias to moz-extension:// for greater extension compatibility.

For instance, this breaks the Reddit Enhancement Suite: https://github.com/honestbleeps/Reddit-Enhancement-Suite/blob/v4.5.4/Chrome/browsersupport-chrome.js#L116-L117
Blocks: 1209184
This no longer blocks Bug 1208765, as RES has moved away from this API.
Whiteboard: [i18n]
I think we're going to try to avoid doing this.
Priority: -- → P3
Flags: blocking-webextensions-
Whiteboard: [i18n] → [i18n]triaged
Whiteboard: [i18n]triaged → [i18n]triaged[DevRel:P3]
Wanting to close based on comment 2, no reports of this blocking anyone either. If you disagree callahad please re-open.
Status: NEW → RESOLVED
Closed: 4 years ago
Component: WebExtensions: Untriaged → WebExtensions: General
Flags: blocking-webextensions-
Resolution: --- → WONTFIX
I'm porting extension from Chrome to WebExtensions API and having several fragments in my css files where I'm using "chrome-extension://" scheme, e.g. 
in font-face:
  src: url(chrome-extension://__MSG_@@extension_id__/css/fonts/SourceSansPro-Regular.otf) format("opentype");

or for loading images:
  background: url('chrome-extension://__MSG_@@extension_id__/img/spinner32.gif') center center no-repeat;

Having that alias would be very handy. Otherwise I need to rewrite all occurences of "chrome-extensions".
Or does it have another workarounds? How am I supposed to load local extension files?
In this use case is chrome-extension://__MSG_@@extension_id__/ needed? I'm able to set a CSS like:

    src: url(Fertigo_PRO.otf) format("opentype");

And it resolves to my local extension and loads the font in both Firefox and Chrome.
It's true for backgound, popup, options pages, but it's not working in content-scripts.
Ah thanks, let's re-open then.
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
Whiteboard: [i18n]triaged[DevRel:P3] → [i18n]triaged[DevRel:P3][design-decision-needed]
Relative URLs work in all static CSS. Dynamically-generated CSS has other options for creating absolute URLs.
Status: REOPENED → RESOLVED
Closed: 4 years ago4 years ago
Resolution: --- → WONTFIX
Ok, it works in Firefox, but doesn't work like this in Chrome. It means that I need to add extra modifications to port my extension into Firefox anyway.

The css rule:
background: url('/img/spinner.gif')
injected by content-script into some page
in Chrome: will be loading from the target page
in Firefox: will be loading from extension resources
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.