Restore file download UI when OnlyOffice plugin is disabled #718
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, the OnlyOffice plugin statically registered mime types with
Hooks.Register.XDGOpen
on initialization; however, this meant that if you disabled the plugin, those mime types would still remain associated with the plugin. In that case, any office document would return a blank page, since it would still attempt to open with the disabled OnlyOffice plugin handlers.This change adds a new
Hooks.Register.XDGOpenFunc
hook, so that code inxdg-open.js
can be evaluated dynamically. With it, mime type overrides can be returned only when the OnlyOffice plugin is enabled.While the private API for
xdg_open
now accepts an array of functions returning a string (similar to the CSS hook), the public API forHooks.Register.XDGOpen
andHooks.Get.XDGOpen
remains unchanged, so this shouldn't break any 3rd party plugins using it.Fixes issue #717.