Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore file download UI when OnlyOffice plugin is disabled #718

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gvengel
Copy link

@gvengel gvengel commented Jul 20, 2024

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 in xdg-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 for Hooks.Register.XDGOpen and Hooks.Get.XDGOpen remains unchanged, so this shouldn't break any 3rd party plugins using it.

Fixes issue #717.

@gvengel
Copy link
Author

gvengel commented Jul 20, 2024

Note, this may be tangentially related to issue #715, as my motivation for disabling OnlyOffice is that I've found it corrupts some documents on save, and that PR is another possible mitigation.

@mickael-kerjean
Copy link
Owner

You're right, it will take me a bit of time to test this out but I'll keep you up to date

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants