apache / apache/cordova-plugin-inappbrowser

Calling window.print() does not work

Open
#1,025 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.1k
Forks
2.2k
PR merge metrics
No merged PRs in 30d

Description

# Feature Request

Enable the usage of window.print() when using the inappbrowser plugin for iOS and Android.

## Motivation Behind Feature

The application I'm working on allows users to print the page using `window.print()`. This works when accessing the application via a web browser, but doesn't work when accessing the application via the inappbrowser plugin.

I'm not entirely sure why this doesn't work on iOS, but [Android has chosen not to implement window.print in WebView](https://bugs.chromium.org/p/chromium/issues/detail?id=322303).

## Feature Description
I think the best way to go about this is to override `window.print` inside of the iOS and Android implementations of the inappbrowser plugin. I've been able to get window.print working on Android via this strategy. I think something similar may be possible in iOS.

The main downside I see to this is that this would override the iOS and Android implementations of window.print if they are ever implemented. In the case of Android, that [seems unlikely to ever happen](https://bugs.chromium.org/p/chromium/issues/detail?id=322303).

Contributor guide

Open the contributing guide

Research direction

Start by locating the iOS and Android implementations of the inappbrowser plugin and review how window.print() behaves in each WebView. Done means window.print() triggers printing on both platforms without breaking existing in-app browsing behavior, with platform-specific verification.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, javascript, objective-c
Domain
mobile
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.