I'm using flutter_webview_plugin and there is a web page in which a button implemented with the window.print function, i need to make that functional - flutter

I'm using flutter_webview_plugin in my flutter application, where I've set some URL to display in the app. The website which I'm using has a button to print the current page. That button is wrapped with this javascript
function myPrint(){
window.print();
}
That function is properly working on the PC and Mobile browsers perfectly, but how could I make that work on the flutter app too?

use this plugin it's so good and has a lot of events, methods, and options
InAppWebView

Related

is In-App Routing possible for a Flutter Webview app with flutter_branch_sdk?

I am using "flutter_inappwebview: ^6.0.0-beta.22" package to make my website into a flutter app.
For me now , when I click/tap the branch shortlink/quicklink , it's opening the app. but not redirecting to the particular webpage(sub page).
I want to achieve the functionality of in-app routing ( when a branch shortlink/quicklink is clicked/tapped, it should open the app and redirected to a specific webpage(sub page) inside the app).
I have done the initial integrations in the dashboard , AndroidManifest.xml and Used the code example code from "https://github.com/BranchMetrics/flutter_branch_sdk/blob/master/example/lib/main.dart" .
Is this functionality achievable in webview apps?
if yes, Please guide me.

How to read website content in Flutter webview?

I want to read the contents of a page opened with Flutter webview. Before the page opens, the user needs to manually enter the information on the previous page, and I have no chance to do this in the background with http. How can I get the data on the opened page with WebView (which can be webview_flutter or flutter_webview_plugin). Thanks in advance.
There is nothing out of the box exactly for that purpose, however, webview_flutter supports communicating with the page using JavascriptChannel. Using controller.evaluateJavascript, you can inject a script that sends the page content to the channel using postMessage. See the examples in the plugin repo.

Not able to Close blackberry 7 browser from my code

Thanks! Hello everyone! I am making a BlackBerry 7 mobile native application. On click of button from my native application. It will be open a URL in a separate browser. So, I want to close the opened browser. The URL it is opening. This URL is separate domain, but this is my page, in this page i have tried following code. But, it is not working -
blackberry.app.exit();
window.close();
System.exit();
I have tried to open the URL in my native application using iframe. But, here always taking me splash screen instead of loading URL.
Are you using WebWorks or Cordova (nee PhoneGap) ? One solution is to use Cordova 2.9 (the last version to support BBOS) and the InAppBrowser API.

titanium webview - go to default browser when clicking links

in titanium, i'm using the webview to display a wordpress blog page, that is already formatted for mobile browser. instead of writing my own interface, this works as a good work around. the apps sole focus isn't the browser.
but my issue lies, when the user clicks a link outside of the initial displayed domain. i only want the main domain to be displayed in the apps browser. if any other link is clicked, that takes the user outside of that domain, i want to have it open in the phones default browser.
can anyone point me in a direction for this. i tried adding a listener to try and catch link clicks, however, i've been unsuccessful.
thanks
in this blog posting I show how to find links in a webpage and change the link behavior. Using the same method, you can intercept the links and redirect to opening the URL in the devices default browser
One solution would be to catch the onclick() Event by Javascript inside the WebView (your blog code) and handle this by a custom handler. Maybe you can inject the javascript event handler code into the running WebView through Titanium.
Another solution is to make your blogposts readable for app technology and create a new data interface. This is the way I would do. For that I would use some kind of JSON data format and a simple REST Interface to get the data.
I don't think bove solutions are that simple. If you want an app with "great feeling", you'll have to handle the events by your own. Maybe Phonegap would be a better solution four your problem. But there you will still need a kind of REST/JSON interface for your blog data. The idea behind an app is, that the main code is in your app and you get the content from a remote source. This way you'll get an advantage compared to a simple browser optimized site.

Possible to open iPhone Safari and target a specific window?

I have an app that uses OAuth to authenticate, which means the user must be directed to the website to authorize the application. I prefer to make it obvious to the user that they are using a standard browser to authorize at the original site rather than just using a web view to show the content within my app. However, every time they are directed to Safari (via openURL), it launches a new Safari window and once Safari has 8 windows open, it simply fails to work at all.
I'm wondering if there is an equivalen to the "target" attribute of an anchor tag in html which would allow me to cause all openURL calls from my application to open in the same window.
There is other functionality that I can expose via the web application, creating a hybrid app between native iphone functionality and web app functionality in Safari, but if I have to launch a new window every time I switch between the app and Safari, it becomes unworkable. The Youtube app is obviously able to return the user to the previous page after showing a video, but that might well be a custom plugin in Safari for iphone. Also, while returning to the previous page is somewhat useful, sending them to a new URL in the existing window really opens up a lot of possiblities.
I'm pretty sure there is no way to pass a target parameter to openURL:.
What I noticed about Safari is that it won't open another tab if the page you are opening with openURL: is/was already open in Safari. It just reloads that page. This might sound trivial and not helpful but perhaps you could use it to your advantage if you can make your web application only use one page. Different views or states could be expressed with #anchor tags.
An example is http://m.flickr.com. Notice their URL structure? It goes http://m.flickr.com/#/home, http://m.flickr.com/#/explore/interesting/, http://m.flickr.com/#/search and so on. All of these are different web pages to the user but to Safari it's all the same page.
I found iOS 6.0.1 Safari will open the same tab with a simple hashtag, without the slashes. So with the above example http://m.flickr.com, openURL to http://m.flickr.com#someinfo opens to the same tab.
In your webpage, use window.location.hash to return the params. In the above example it will return #someinfo.