Skip to content

pdf: let launch action to open pdfs from click event

Nelson Ben requested to merge open_pdf into main

Issue #1333 (closed) removed Evince ability to run any command from pdf 'launch action', while the security concerns brought up in #1333 (closed) were valid, the measure implemented was maybe too drastic, as there are valid use cases where launching a pdf is needed.

For instance, the cases described in issue #48 (closed), one of them is the document 'Nissan Patrol Maintenance Manual' which is comprised of several pdf files, where there is one acting as index for the others, this index pdf file uses the launch action to open the other pdf's.

So this commit allows to launch a file from a link action only when:

  • that file is a pdf file.
  • the launch action originates from click event, to be sure the user requested the action.

Besides, we don't just let the system execute the file, but because it's a pdf we do it ourselves by launching a new evince instance (or if that file was already opened then presenting its window).

Fixes issue #48 (closed)

Merge request reports