Persona is no longer an option for authentication on BMO. For more details see Persona Deprecated.
Last Comment Bug 391286 - implement registerContentHandler for arbitrary MIME types
: implement registerContentHandler for arbitrary MIME types
Status: NEW
Product: Firefox
Classification: Client Software
Component: File Handling (show other bugs)
: unspecified
: All All
: -- enhancement with 23 votes (vote)
: Future
Assigned To: Nobody; OK to take it and work on it
: William Hsu [:whsu]
: 471370 (view as bug list)
Depends on:
Blocks: webapi b2g-v-next
  Show dependency treegraph
Reported: 2007-08-07 15:57 PDT by Dan Mosedale (:dmose)
Modified: 2016-07-31 21:41 PDT (History)
37 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Ver (26.15 KB, text/html)
2008-04-18 06:32 PDT, K.Horikawa
dsicore: approval1.9-

Description Dan Mosedale (:dmose) 2007-08-07 15:57:52 PDT
Spun off from bug 372441.
Comment 1 K.Horikawa 2008-04-12 06:53:27 PDT
Comment 2 K.Horikawa 2008-04-18 06:32:58 PDT
Created attachment 316428 [details]

[Exception... "Component is not available" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: file:///C:/Program%20Files/Mozilla%20Firefox/components/nsSessionStore.js :: sss_saveState :: line 1753" data: no]
(無題)()prototype-1.4.0.j... (549 行目)
these()prototype-1.4.0.j... (83 行目)
getTransport()prototype-1.4.0.j... (550 行目)
initialize("/script/tree_win.js", Object method=get evalScripts=false)prototype-1.4.0.j... (624 行目)
create()prototype-1.4.0.j... (20 行目)
treeLoadStart("win", "/win/art/graphics/edit/")tree_onoff.js (83 行目)

oState.session = { state: ((this._loadState == STATE_RUNNING) ? STATE_RUNNING_STR : STATE_STOPPED_STR) };
Comment 3 Samuel Sidler (old account; do not CC) 2008-04-21 11:16:38 PDT
Comment on attachment 316428 [details]

Please don't grant review on your own patches. Additionally, please do not request approval on patches that are clearly not reviewed and have no clear statement to what they do (and have nothing to do with the bug they're attached to).

Clearing review, approval, and marking this as obsolete.
Comment 4 Jesse Ruderman 2008-12-30 19:13:30 PST
*** Bug 471370 has been marked as a duplicate of this bug. ***
Comment 5 JackieKu 2010-01-21 00:51:55 PST
I think Google Docs Viewer is a good example why this is needed.
Comment 6 Eli Grey (:sephr) 2010-05-09 20:43:02 PDT
This would be great to be able to automatically open application/x-tinylog files (a log format I developed for a library of the same name) in a viewer for said files I have created.
Comment 7 Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please) 2011-09-21 07:15:46 PDT
Let's say I want register as the content handler for application/pdf files coming from everywhere on the internet, would it be possible or the same-origin policy will prevent that?
Comment 8 skierpage 2012-07-05 13:34:24 PDT
Every week someone develops HTML+JavaScript to handle another file format: pdf, OpenDocument, jpeg2000, swf, webp, mp3, webm, swf again, flac, etc.  Yet Firefox won't let me tell it "use this URL to handle this format."  The absence of this feature is holding the browser back, and it's forcing users to mess with saving locally then launching native applications to handle formats *that their browser is perfectly capable of presenting*!  All this innovation is kept out of the hands of users and only accessible on a handful of demo web sites that incorporate the code.

Until this core feature is somehow addressed, maybe someone could write a tutorial explaining how to package HTML+js that handles a mimetype into an extension, based on how pdf.js does it.  Or maybe someone could write a meta-extension like that lets you nominate web sites (or their code saved locally) to handle mime types.  Looking at the 400 dense lines of code in pdf.js' components/PdfStreamConverter.js it seems quite complex to hand a stream off to a viewer.html for processing.
Comment 9 Benjamin Young 2014-08-14 14:09:06 PDT
There is a MIME Type blacklist for `registerContentHandler` in the HTML5 specification:

That should be used in place of the current Atom & RSS feed focused whitelist:
Comment 10 Brett Zamir 2015-01-24 20:08:08 PST
Is there any timeline for implementation, or if this is competing with Web Intents or its successors, is there anywhere the progress can be tracked? I agree with comment 8 that this functionality is critical but such web-based extensibility seems perpetually stalled.

Please let me know if this would require a new bug, but I think the handling of arbitrary MIME types would be much more useful if the user could control files opened from the file system (better than the arcane registry editor on Windows hopefully!) and define new MIME type-file extension associations, whether for OpenWith or default opening for files from the desktop (if not allow sites to suggest associations with user confirmation of non-blacklisted MIME types).

This looks like it would be doable for Windows through . (Detection is as per )

FWIW, I've taken a somewhat different approach to allowing file types to be opened (at least from the desktop) in a web app of choice: (currently Windows only).

Also in reply to comment 8, I haven't worked with content types, but it looks like you need to add a category entry using with, e.g., the category "ext-to-type-mapping" set to "foo" to register for "application/x-foo".
Comment 11 Brett Zamir 2015-01-24 21:09:36 PST
And just in case anyone says that local file content types is the business of the desktop and not the browser, I'd like to point out that the lack of an easy way to define associations (whether for particular files or file extensions), whether OpenWith or default opening, web apps cannot become first class citizens as with native apps, and the data silo model cannot be replaced with the app-agnostic possibilities available to native apps on the desktop but not to web apps for desktop files (or remote files).

Note You need to log in before you can comment on or make changes to this bug.