-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Listen to requests #206
Comments
There are also other ways to execute some javascript that is not restricted to injecting a javascript file! You can also use:
For example, I loaded ...
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("InAppWebView")
),
body: Container(
child: Column(children: <Widget>[
Expanded(
child: Container(
child: InAppWebView(
initialUrl: "https://twitter.com/home",
initialHeaders: {},
initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions(
debuggingEnabled: true,
)
),
onWebViewCreated: (InAppWebViewController controller) {
webView = controller;
},
onLoadStart: (InAppWebViewController controller, String url) {
},
onLoadStop: (InAppWebViewController controller, String url) {
controller.evaluateJavascript(source: "alert('HI');");
controller.loadUrl(url: "javascript:(function(){ alert('HI'); })();");
},
),
),
),
]))
);
}
... However, chrome APIs, such as |
I'll definitely try that! |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue. |
Description
Hi,
I'm developing an app where the user is required to do few things in different websites, and I have to detect whether he completed that task or not.
In a few websites I can simply inject some javascript and send a message back to the app, but there are some websites that I cannot to that since they block inline javascript, or that's what I understood (Ex: twitter.com).
So looking for other option, I stumbled across the "chrome.webRequest" API which is used to listen to requests made from a page. However it looks like this API is mainly for extensions.
I wonder if it is possible to do something like that with InAppWebView package.
Thank you.
The text was updated successfully, but these errors were encountered: