I basically have a normal WebView controller setup in flutter to access a website. When I use that websites sign in button i get 2 errors.
I/chromium( 7803): [INFO:CONSOLE(192)] “Uncaught Error: no window opener”,
I/chromium( 7803): [INFO:CONSOLE(1)] “Uncaught TypeError: Cannot read properties of null (reading ‘postMessage’)”,
I assume the actual window is being lost somewhere and then the website can’t find it.
This is my current webview code
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
class WebViewContainer extends StatefulWidget {
const WebViewContainer({super.key});
@override
State<WebViewContainer> createState() => _WebViewContainerState();
}
class _WebViewContainerState extends State<WebViewContainer> {
final controller = WebViewController()
..setJavaScriptMode(JavaScriptMode.unrestricted)
..setNavigationDelegate(NavigationDelegate(
onNavigationRequest: (NavigationRequest request){
return NavigationDecision.navigate;
}
))
..loadRequest(Uri.parse('TheWebsite'));
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("")
),
body: WebViewWidget(controller: controller),
);
}
}
Alex Pretorius is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.