tksugimoto / chrome-extension_open-local-file-link

ローカルファイルへのリンク(file://~)を開けるようにするChrome拡張
https://chrome.google.com/webstore/detail/nikfmfgobenbhmocjaaboihbeocackld
MIT License
95 stars 38 forks source link

Easy way to open Office files #23

Open kspeakman opened 2 years ago

kspeakman commented 2 years ago

I noticed this Todo: open Office documents directly.

Office (and Libre Office) install URI schemes for Office documents. They bypass the Chrome file link restriction. So rewriting the links with the document-specific URI scheme in front should accomplish this goal. For example:

Chrome behavior (without plugin)

The Office document schemes can be found here.

Caveats

If the computer does not have registered handlers (i.e. Office is not installed), these links will be ignored and a console error will be logged. So it would be ideal to rewrite the links only if there are registered handlers. So the plugin will still allow them to be downloaded if Office is not installed.