Next Release?

Jürgen Spitzmüller jspitzm at gmail.com
Wed Aug 30 09:47:40 UTC 2023


Am Mittwoch, dem 30.08.2023 um 11:12 +0200 schrieb Pavel Sanda:
> I understand your concern and as said do not oppose fixing this.
> 
> On the other hand, I realized yesterday night, that the latest
> patch is game over for me. It relays the execution to Qt, which
> in turns relays that to xdg on linux system. If you are out of
> mainstream DEs like Gnome or KDE, bad luck for you(*). 

But independent of my patch we use this chain for the other
citation_view chains (url, file, doi, etc.). So we need to fix it
anyway.

On a very quick view, it seems we can use
QDesktopServices::setUrlHandler() to redirect QDesktopServices to our
own viewers rather than using the default (xdg-open on Linux). This
would also allow to set viewer options.

> If we go with your patch then I need to fiddle with xdg/mime on each
> system I want to use lyx -- or rather revert locally your patch.
> Doable, but somewhat sad result for the feature I conceived :)
> 
> So my plea is to allow running more powerful scripts via the
> "?internally_handled?" return flag (see my other mail) while letting
> the default to be more security aware.

If the solution above (setUrlHandler()) does what I think it does, are
these woes cured?

Otherwise:

Does your personal script still work without the viewers being passed?
I suppose you can set the viewers you want in the script directly,
right?

If so, I'd propose a somewhat different approach:

* implement a script option -d (dangerous) that simply returns "no" by
default and otherwise does not execute the script

* in your own script, you can make it return "yes"

* we can then query for this before launching the script, and if it is
dangerous, we do:

  -- issue a big fat warning (which can be disabled for the current
document)
  -- if the user agrees, let the script to its job and don't open
anything.

But I'd suggest we try to address the openUrl problem first.

-- 
Jürgen


More information about the lyx-devel mailing list