Skip to content

Commit 9df996a

Browse files
committed
fix server detection
1 parent 9038cea commit 9df996a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/base.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class pdfmake {
2828
options.progressCallback = this.progressCallback;
2929
options.tableLayouts = this.tableLayouts;
3030

31-
const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
32-
if (typeof this.urlAccessPolicy === 'undefined' && !isBrowser) {
31+
const isServer = typeof process !== 'undefined' && process?.versions?.node;
32+
if (typeof this.urlAccessPolicy === 'undefined' && isServer) {
3333
console.warn(
3434
'No URL access policy defined. Consider using setUrlAccessPolicy() to restrict external resource downloads.'
3535
);

0 commit comments

Comments
 (0)