What is a resource url: //?

I recently came across a webpage containing the following markup line:

<script src="resource://ember-inspector-at-emberjs-dot-com/ember-inspector/data/in-page-script.js"></script> 

Note that the scheme in the URL is a “resource” and that the URL is not intended for what can be reached via the Internet.

This is not a URL scheme that I have met before. Despite some searches on this subject, I cannot find any information about using this scheme.

What is the purpose of the "resource" scheme? If I were a browser, what would I do with this?

+6
source share
1 answer

Resource Schema: The URI is exclusive to Firefox and has been registered in Firefox v3.

It is used internally related to chrome.manifest.

In Firefox, type this into the address bar and navigate to it.

 resource:/// 

You should find the directory structure of your local Firefox user profile.

Background

Mozilla has several URIs registered. These include the resource: and chrome: (the latter being more familiar)

The Chrome directory is an important part of any Firefox installation. Inside the Chrome directory there are data files, documents, scripts, images, etc. All of these files contain user interface elements and local user data.

But chrome: // URI is actually just a special case of a lesser-known resource: // URI, which points to the top of the platform installation area. All paths in the chrome directory must begin with a resource: or jar:

Information found in Mozilla Rapid Application Development by Nigel MacFarlan

Specific Use Case .. Emberjs

In the specific case you were talking about, you can find more information here: https://github.com/emberjs/ember-inspector/issues/82


Questions

We allowed access to the resource: ///, which pointed to the resources installed on the disk that came with Firefox. I don’t know if we can support alternative resource aliases at that time, but I’m sure that add-ons didn’t use them and that we didn’t support resource mapping in chrome.manifest (which was not).

When we presented the resource in chrome.manifest, we should add the option contentaccessible = yes mechanism at the same time: let add-ons not allow fingerprints in the same way as we do with chrome content. Unfortunately, everything we do may have compatibility issues: finding the source of the addon I find 810 chrome.manifest files that define the user resource: // location. One of the reasons for so many reasons is that it is used by JetPack add-ons, so I somewhat hope that most of these do not need to be referenced from the content. Quoted from link 2 below.


The only reasons you will need to use the resource is to make web content available. Quoted from link 2 below.

Directly from Mozilla

It was very difficult for me to find a mention of the resource: // in any Mozilla, IANA or W3C documentation. This is the only and ONLY direct reference to the definition of a resource: I could find it published directly from Mozilla. It was so incomprehensible that I took a screenshot :)

enter image description here

Further reading:

+6
source

Source: https://habr.com/ru/post/975872/


All Articles