Skip to content

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

@mickael-kerjean mickael-kerjean force-pushed the master branch 6 times, most recently from b95fa04 to 11c4a74 Compare September 2, 2025 13:52
@mickael-kerjean mickael-kerjean force-pushed the master branch 5 times, most recently from 9757ff1 to 7fa253f Compare September 11, 2025 05:00
@mickael-kerjean mickael-kerjean force-pushed the master branch 2 times, most recently from 5e9f59a to b9f2ee9 Compare September 23, 2025 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants