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

GH-1025 android: enable window.print() #1026

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

veelci
Copy link

@veelci veelci commented Sep 25, 2023

Platforms affected

Android

Motivation and Context

This change enables usage of window.print() on Android
Partially implements #1025

Description

window.print is not implemented in Android's WebView. This change adds a print method to the cordova_iab JavaScript interface and overrides window.print to call the new print method.

Testing

  1. Load up any Cordova application in an Android emulator. (I was using an emulated Pixel 7 Pro API 33)
  2. Open up the Web Inspector JavaScript Console.
  3. Run window.print() in the console.
  4. The print preview should appear.

I attempted to run the cordova-mobile-spec tests, but encountered an error when running cordova-mobile-spec/createmobilespec/createmobilespec.js --android.

Error: Module cordova-lib installed in cordova-plugman is not npm-linked. I recommend you run "coho npm-link".
    at verifyNpmLinkOf (/Users/victorelci/Projects/cordova-test/cordova-mobile-spec/createmobilespec/createmobilespec.js:337:19)
    at Object.<anonymous> (/Users/victorelci/Projects/cordova-test/cordova-mobile-spec/createmobilespec/createmobilespec.js:358:9)

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

@NiklasMerz NiklasMerz added this to the Android fixes milestone Nov 4, 2023
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