You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "veelci (via GitHub)" <gi...@apache.org> on 2023/09/25 21:31:08 UTC

[GitHub] [cordova-plugin-inappbrowser] veelci opened a new pull request, #1026: GH-1025 android: enable window.print()

veelci opened a new pull request, #1026:
URL: https://github.com/apache/cordova-plugin-inappbrowser/pull/1026

   ### 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](https://bugs.chromium.org/p/chromium/issues/detail?id=322303).  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](https://github.com/apache/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
   - [x ] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`)
   - [x ] 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](https://help.github.com/articles/closing-issues-using-keywords/))
   - [ ] I've updated the documentation if necessary
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [PR] GH-1025 android: enable window.print() [cordova-plugin-inappbrowser]

Posted by "GitToTheHub (via GitHub)" <gi...@apache.org>.
GitToTheHub commented on PR #1026:
URL: https://github.com/apache/cordova-plugin-inappbrowser/pull/1026#issuecomment-4415211493

   Hi, can you add a documentation to the README that `window.print` is supported for Android and also the Browser? You can take this documentation example:
   
   ```md
   ## window.print
   
   > Triggers the print dialog for the page loaded in the `InAppBrowser` window.
   
       window.print();
   
   ### Supported Platforms
   
   - __Android__: Supported
   - __Browser__: Supported
   - __iOS__: Not supported
   ```
   
   and can add it after the `cordova.InAppBrowser.open` section.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org