Skip to content

Commit 672995a

Browse files
committed
Version 2.4.12
## Version 2.4.12 - December 17, 2025 - **Fixed:** Error when viewer is put into a cross-domain iframe: `Uncaught (in promise) SecurityError: Failed to read a named property 'matchMedia' from 'Window'` Also prevent `missing document error` when `documentUrl` is a relative url and viewer is inside a cross-domain iframe. Also avoid `Blocked autofocusing on a <button> element in a cross-origin subframe.` browser warning by not using `autofocus` attribute. - **Added:** New permission `options.permissions.runScripts` with default value of `true`. For security purpose, you can now disable execution of active content (JavaScript) by PDF files.
1 parent e6923ab commit 672995a

File tree

9 files changed

+24
-10
lines changed

9 files changed

+24
-10
lines changed

APIDocs.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ Renders PDF.js viewer in an iframe but updates UI theme and structure for a neat
254254
* `options.permissions.editAnnotations` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Ability to edit annotations of the document. Tools like Add Signature, Highlight, Draw, Add Image will be available. If no ViewAnnotations permission, then you can add new annotations but not view and edit existing ones. (optional, default `true`)
255255
* `options.permissions.fillForms` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Ability to fill values into form fields of the document. Requires also ViewAnnotations permission. (optional, default `true`)
256256
* `options.permissions.editComments` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Ability to edit comments of the document. (optional, default `true`)
257+
* `options.permissions.runScripts` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Ability to allow execution of active content (JavaScript) by PDF files. (optional, default `true`)
257258
* `options.searchOptions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** The text search options of the viewer.If you specify a search term, an automatic search will be done when the document is displayed,
258259
i.e. the specified term will be searched and the term(s) will be highlighted in the pages.
259260
For example, if you launch the viewer from a search results page, you can pass the same search term to the viewer.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ Here is a list of all the options with the default values, that can be passed to
127127
viewAnnotations: true,
128128
editAnnotations: true,
129129
fillForms: true,
130-
editComments: true
130+
editComments: true,
131+
runScripts: true
131132
},
132133

133134
searchOptions: {

dist/docs/index.html

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset='utf-8'>
5-
<title>pdfjskit 2.4.11 | Documentation</title>
5+
<title>pdfjskit 2.4.12 | Documentation</title>
66
<meta name='description' content='PdfJsKit is a PDF Viewer built on top of PDF.js, with modern UI and new features which supports integration for all JS frameworks.'>
77
<meta name='viewport' content='width=device-width,initial-scale=1'>
88
<link href='assets/bass.css' rel='stylesheet'>
@@ -16,7 +16,7 @@
1616
<div id='split-left' class='overflow-auto fs0 height-viewport-100'>
1717
<div class='py1 px2'>
1818
<h3 class='mb0 no-anchor'>pdfjskit</h3>
19-
<div class='mb1'><code>2.4.11</code></div>
19+
<div class='mb1'><code>2.4.12</code></div>
2020
<input
2121
placeholder='Filter'
2222
id='filter-input'
@@ -1307,6 +1307,17 @@ <h3 class='fl m0' id='pdfviewer'>
13071307

13081308

13091309

1310+
<tr>
1311+
<td class='break-word'><span class='code bold'>options.permissions.runScripts</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a></code>
1312+
1313+
(default <code>true</code>)
1314+
</td>
1315+
<td class='break-word'><span>Ability to allow execution of active content (JavaScript) by PDF files.
1316+
</span></td>
1317+
</tr>
1318+
1319+
1320+
13101321

13111322

13121323

dist/pdfjskit/pdfjskit.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/pdfjskit/pdfjskit.min.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

examples/pdfjskit-vite-example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
"vite": "^5.4.8"
1313
},
1414
"dependencies": {
15-
"pdfjskit": "^2.4.11"
15+
"pdfjskit": "^2.4.12"
1616
}
1717
}

package/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ Here is a list of all the options with the default values, that can be passed to
127127
viewAnnotations: true,
128128
editAnnotations: true,
129129
fillForms: true,
130-
editComments: true
130+
editComments: true,
131+
runScripts: true
131132
},
132133

133134
searchOptions: {

package/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pdfjskit",
3-
"version": "2.4.11",
3+
"version": "2.4.12",
44
"description": "PdfJsKit is a PDF Viewer built on top of PDF.js, with modern UI and new features which supports integration for all JS frameworks.",
55
"keywords": [
66
"pdf-viewer",

0 commit comments

Comments
 (0)