diff --git a/README.md b/README.md index 9cf97e8..9c945a8 100644 --- a/README.md +++ b/README.md @@ -16,19 +16,19 @@ You can download the latest version of Print.js from the [GitHub releases](https To install via npm: ```bash -npm install print-js --save +npm install custom-print-js --save ``` To install via yarn: ```bash -yarn add print-js +yarn add custom-print-js ``` Import the library into your project: ```js -import printJS from 'print-js' +import printJS from 'custom-print-js' ``` ## Documentation diff --git a/package.json b/package.json index 225fb7d..16aee05 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { - "name": "print-js", + "name": "custom-print-js", "homepage": "http://printjs.crabbly.com", "description": "A tiny javascript library to help printing from the web.", - "version": "1.6.0", + "version": "1.6.1", "main": "dist/print.js", "types": "src/index.d.ts", "repository": "https://github.com/crabbly/Print.js", diff --git a/src/js/print.js b/src/js/print.js index 40f9629..e072354 100644 --- a/src/js/print.js +++ b/src/js/print.js @@ -13,7 +13,7 @@ const Print = { iframeElement.onload = () => { if (params.type === 'pdf') { // Add a delay for Firefox. In my tests, 1000ms was sufficient but 100ms was not - if (Browser.isFirefox() && Browser.getFirefoxMajorVersion() < 110) { + if ((Browser.isFirefox() && Browser.getFirefoxMajorVersion() < 110) || Browser.isSafari()) { setTimeout(() => performPrint(iframeElement, params), 1000) } else { performPrint(iframeElement, params) @@ -72,7 +72,7 @@ function performPrint (iframeElement, params) { } catch (error) { params.onError(error) } finally { - if (Browser.isFirefox() && Browser.getFirefoxMajorVersion() < 110) { + if ((Browser.isFirefox() && Browser.getFirefoxMajorVersion() < 110) || Browser.isSafari()) { // Move the iframe element off-screen and make it invisible iframeElement.style.visibility = 'hidden' iframeElement.style.left = '-1px'