feat: add Android sharing intent support, network security configuration, and headless link extraction service
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
|
||||
|
||||
abstract class ILinkExtractionService {
|
||||
@@ -17,6 +18,24 @@ class LinkExtractionService implements ILinkExtractionService {
|
||||
|
||||
_headlessWebView = HeadlessInAppWebView(
|
||||
initialUrlRequest: URLRequest(url: WebUri(pageUrl)),
|
||||
initialSettings: InAppWebViewSettings(
|
||||
javaScriptEnabled: true,
|
||||
isInspectable: true,
|
||||
mixedContentMode: MixedContentMode.MIXED_CONTENT_ALWAYS_ALLOW,
|
||||
userAgent: "Mozilla/5.0 (Linux; Android 13; Pixel 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Mobile Safari/537.36",
|
||||
),
|
||||
onReceivedServerTrustAuthRequest: (controller, challenge) async {
|
||||
return ServerTrustAuthResponse(action: ServerTrustAuthResponseAction.PROCEED);
|
||||
},
|
||||
onConsoleMessage: (controller, consoleMessage) {
|
||||
debugPrint("WEBVIEW CONSOLE: ${consoleMessage.message}");
|
||||
},
|
||||
onLoadError: (controller, url, code, message) {
|
||||
debugPrint("WEBVIEW ERROR: $message ($code) for $url");
|
||||
},
|
||||
onLoadHttpError: (controller, url, statusCode, description) {
|
||||
debugPrint("WEBVIEW HTTP ERROR: $description ($statusCode) for $url");
|
||||
},
|
||||
onLoadResource: (controller, resource) {
|
||||
final url = resource.url.toString();
|
||||
if (_isVideoUrl(url)) {
|
||||
|
||||
Reference in New Issue
Block a user