You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
window.print() JavaScript function doesn't work with StageWebView loaded web pages. It do nothing.
It has been tested with multiple AIR versions even with latests AIR 32.0.0.89, AIR 32.0.0.144, AIR 33.0.2.338 and AIR 33.1.0.16 beta with many macOS and iOS devices. It doesn't matter if you use URL link or HTML code provided by String with StageWebView.
Same problem in all cases.
The same works fine with system browsers with the same devices.
It doesn't work with StageWebView(true), StageWebView(false) and HTMLLoader.
But it works fine with Windows using StageWebView(true).
Also it doesn't work with Android but there are some OS limitations (https://stackoverflow.com/questions/26684190/using-window-print-or-alternative-on-android-devices). It could be usefull if we could grab BitmapData of all page (not just viewPort screenshot) to use it to print via native extension or another way. window.print() behavior should be available to override by AIR because if it will be uncontrollable it could provide security vulnerability for kiosks (and other such solutions) where no system dialog windows allowed.
Steps to Reproduce
Launch code below with macOS or iOS device and click to "Print" button in loaded web page inside StageWebView. "Print" button make window.print() JavaScript call.
Print (via PrintJob) viewPort screenshot which captured by StageWebView::drawViewPortToBitmapData() or drawn from HTMLLoader. You need separate button out from webview. So technically you also cannot get full screenshot and initiate print from web page.
Write native extension with webview imlementation.
The text was updated successfully, but these errors were encountered:
FYI
macOS print functionality has been (famously) broken in WKWebView for several years and despite bug reports it looks like there is no sign of Apple fixing it any time soon.
Problem Description
window.print()
JavaScript function doesn't work withStageWebView
loaded web pages. It do nothing.It has been tested with multiple AIR versions even with latests AIR 32.0.0.89, AIR 32.0.0.144, AIR 33.0.2.338 and AIR 33.1.0.16 beta with many macOS and iOS devices. It doesn't matter if you use URL link or HTML code provided by
String
withStageWebView
.Same problem in all cases.
The same works fine with system browsers with the same devices.
It doesn't work with
StageWebView(true)
,StageWebView(false)
andHTMLLoader
.But it works fine with Windows using
StageWebView(true)
.Also it doesn't work with Android but there are some OS limitations (https://stackoverflow.com/questions/26684190/using-window-print-or-alternative-on-android-devices). It could be usefull if we could grab
BitmapData
of all page (not justviewPort
screenshot) to use it to print via native extension or another way.window.print()
behavior should be available to override by AIR because if it will be uncontrollable it could provide security vulnerability for kiosks (and other such solutions) where no system dialog windows allowed.Steps to Reproduce
Launch code below with macOS or iOS device and click to "Print" button in loaded web page inside
StageWebView
. "Print" button makewindow.print()
JavaScript call.Application example with sources attached.
stagewebview_print_bug.zip
Actual Result:
Nothing happens.
Expected Result:
Print dialog will be provided to choose printer like with Windows.
Known Workarounds
none
HTMLLoader
with overriding JSwindow.print()
and JS->AS3 communication using https://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118666ade46-7ed5.html butHTMLLoader
doesn't support latests HTML5/CSS3 standards. Also you can only getHTMLLoader
viewport screenshot to use it withPrintJob
.PrintJob
)viewPort
screenshot which captured byStageWebView::drawViewPortToBitmapData()
or drawn fromHTMLLoader
. You need separate button out from webview. So technically you also cannot get full screenshot and initiate print from web page.The text was updated successfully, but these errors were encountered: