From 59442f0988b39309b9bfcda4c0cc6f8d0a69b8a0 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 23 Sep 2022 08:00:06 +0000 Subject: [PATCH] [IMP] web: open external links of PDFs in new tab Reimplementation of 74fa91e0b381d1eaee188a95620d3ea84ffb5fe3 on top of new version of pdfjs. See previous commit for explanation. Ideally we would set that behaviour from the outside using e.g. `PDFViewerApplicationOptions.set` but there are multiple locations from which we embed the viewer, which makes that a difficult proposition. There should probably be a clean component which handles loading the library, configuring it to our specifications (possibly on a per-embed basis), and exposing both manipulations methods and events which pdfjs triggers on its eventBus. Part-of: odoo/odoo#100067 --- addons/web/static/lib/pdfjs/web/viewer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/lib/pdfjs/web/viewer.js b/addons/web/static/lib/pdfjs/web/viewer.js index 90d70f9d953..c051399c568 100644 --- a/addons/web/static/lib/pdfjs/web/viewer.js +++ b/addons/web/static/lib/pdfjs/web/viewer.js @@ -16861,7 +16861,7 @@ class BasePreferences { "enablePermissions": false, "enablePrintAutoRotate": true, "enableScripting": true, - "externalLinkTarget": 0, + "externalLinkTarget": 2, "historyUpdateUrl": false, "ignoreDestinationZoom": false, "forcePageColors": false,