Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promote 2.3 dev to production #299

Merged
merged 15 commits into from
Feb 14, 2024
Merged

Promote 2.3 dev to production #299

merged 15 commits into from
Feb 14, 2024

Conversation

pipwerks
Copy link
Owner

No description provided.

Bumping version # before I forget
None of the major browser vendors actively support navigator.mimeTypes. The oldest browser supported by PDFObject (IE11) uses ActiveX. Time to clean house.
Clean up
Removed embed element in favor of more widely supported iframe. This also enables removal of special handling for Safari (macOS desktop edition).

As a result, the forceIframe option will no longer be utilized. The change is backwards-compatible, specifying forceIframe: true will not generate errors.
The logic is spelled out in code comments, but the gist is that we only execute tests when needed, not all up front as previously written. We also add a check for navigator.pdfViewerEnabled prior to doing any sniffing (we can avoid sniffing if navigator.pdfViewerEnabled is available and true). Finally, we revert to prior logic involving assumptions about modern browsers having native PDF support, and IE11 using ActiveX.

These changes modernize the approach, as should be more performant as it reduces the number of browser checks
Using variable for window to aid in minification
Modified PDF Open Params handling:
* ensures page is always set if comment, viewrect or highlight are specified
* always puts page as first param in URL (as required for comment, viewrect, and highlight)
* changed string building from concatenation to array.join. Simpler, cleaner.
* Simplified embedError function and suppressConsole handling
Ensure fdf is always listed last in the URL string, per Adobe docs
If specified PDF is a base64 string, and the browser is unable to display the PDF, convert the base64 string to a downloadable file and present link to user.
IE11 doesn't support fetch() so we have to go old-school with xhr.

Can't wait to drop IE11.
@pipwerks pipwerks merged commit ebb3a6a into master Feb 14, 2024
@pipwerks pipwerks deleted the 2.3-dev branch February 14, 2024 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants