-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace custom "Open With" with default "Open With"
Remove the registry of external applications, and change the option to use Firefox's default "Open With" dialog (if any).
- Loading branch information
Showing
14 changed files
with
23 additions
and
389 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/** | ||
* (c) 2013 Rob Wu <[email protected]> (https://robwu.nl) | ||
*/ | ||
/* globals Prefs, MimeActions, mime_fromFilename, ModalDialog, OpenWith, ContentHandlers */ | ||
/* globals Prefs, MimeActions, mime_fromFilename, ModalDialog, ContentHandlers */ | ||
'use strict'; | ||
|
||
var dialogURL = chrome.extension.getURL('dialog.html'); | ||
|
@@ -73,7 +73,6 @@ chrome.webRequest.onHeadersReceived.addListener(async function(details) { | |
guessedMimeType: guessedMimeType, | ||
mimeType: mimeType, | ||
isSniffingMimeType: isSniffingMimeType, | ||
openWithOptions: OpenWith.getAvailableViewers([mimeType, guessedMimeType]) | ||
}; | ||
var dialog = new ModalDialog({ | ||
url: dialogURL + '#' + encodeURIComponent(JSON.stringify(dialogArguments)), | ||
|
@@ -98,7 +97,8 @@ chrome.webRequest.onHeadersReceived.addListener(async function(details) { | |
Prefs.setMimeAction(guessedMimeType, isSniffingMimeType, desiredAction); | ||
} | ||
if (desiredAction.action === MimeActions.OPENWITH) { | ||
return OpenWith.openWith(desiredAction.openWith, details); | ||
// Don't modify the response headers and let the browser handle the request. | ||
return; | ||
} | ||
return { | ||
responseHeaders: details.responseHeaders | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,18 +124,11 @@ <h2>Your saved MIME actions</h2> | |
</table> | ||
</div> | ||
|
||
<h2>"Open with" viewers</h2> | ||
External viewers allows you to display many other files directly in the browser.<br> | ||
|
||
<div class="row" id="external-viewers"> | ||
</div> | ||
|
||
<footer> | ||
© 2013 - 2017 Rob Wu <[email protected]> | ||
• <a href="https://github.com/Rob--W/open-in-browser">Source code on Github</a> | ||
</footer> | ||
<script src="prefs.js"></script> | ||
<script src="external-viewers.js"></script> | ||
<script src="options.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.