The default bug view has changed. See this FAQ.

Add JSM to hardcoded extensions/mime type list

RESOLVED FIXED in mozilla24

Status

Core Graveyard
File Handling
RESOLVED FIXED
4 years ago
9 months ago

People

(Reporter: vladan, Assigned: vladan)

Tracking

(Blocks: 1 bug)

unspecified
mozilla24

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
Created attachment 760681 [details] [diff] [review]
Hardcode the MIME-type of .JSM files

The MIME type of the .JSM extension isn't hardcoded, so the first time Firefox loads a JSM, it has to initialize the plugin list (nsPluginHost::LoadPlugins) to try to figure out the file's MIME type. This is not the case for .JS files.

It is expensive to initialize the plugin list since it involves stat'ing lots of plugin directories and libraries on the main thread during startup.
Attachment #760681 - Flags: review?(ehsan)
(Assignee)

Comment 1

4 years ago
https://tbpl.mozilla.org/?tree=Try&rev=4d912c911063
Comment on attachment 760681 [details] [diff] [review]
Hardcode the MIME-type of .JSM files

Review of attachment 760681 [details] [diff] [review]:
-----------------------------------------------------------------

::: uriloader/exthandler/nsExternalHelperAppService.cpp
@@ +466,5 @@
>    { "application/rtf", "rtf", "Rich Text Format File" },
>    { APPLICATION_XPINSTALL, "xpi", "XPInstall Install" },
>    { APPLICATION_POSTSCRIPT, "ps,eps,ai", "Postscript File" },
>    { APPLICATION_XJAVASCRIPT, "js", "Javascript Source File" },
> +  { APPLICATION_XJAVASCRIPT, "jsm", "Javascript Source File" },

Now that you actually asked for my review, here's a nit!

"Javascript Module Source File"
Attachment #760681 - Flags: review?(ehsan) → review+
(Assignee)

Comment 3

4 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/b6805a18ea30
https://hg.mozilla.org/mozilla-central/rev/b6805a18ea30
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.