XFA - Add <a> element in button when an url is detected (bug 1716758)

- it aims to fix https://bugzilla.mozilla.org/show_bug.cgi?id=1716758;
  - some buttons have a JS action with the pattern `app.launchURL(...)` (or similar) so extract when it's possible the url and generate a <a> element with the href equals to the found url;
  - pdf.js already had some code to handle that so this patch slightly refactor that.
This commit is contained in:
Calixte Denizet 2021-09-25 14:46:40 +02:00
parent 3b1d547738
commit 558e58f354
8 changed files with 173 additions and 44 deletions

View file

@ -1108,7 +1108,7 @@ describe("annotation", function () {
jsEntry: "window.open('http://www.example.com/test.pdf')",
expectedUrl: new URL("http://www.example.com/test.pdf").href,
expectedUnsafeUrl: "http://www.example.com/test.pdf",
expectedNewWindow: undefined,
expectedNewWindow: false,
});
// Check that we accept a white-listed {Stream} 'JS' entry.