Next typos fixes

This commit is contained in:
Michal Srutek 2023-12-21 08:21:41 +01:00
parent 38e28bec42
commit ecfcb3d9f5
20 changed files with 53 additions and 53 deletions

View File

@ -202,7 +202,7 @@ public class Util {
/**
* SslCertificate class does not has a public getter for the underlying
* X509Certificate, we can only do this by hack. This only works for andorid 4.0+
* X509Certificate, we can only do this by hack. This only works for Android 4.0+
* https://groups.google.com/forum/#!topic/android-developers/eAPJ6b7mrmg
*/
public static X509Certificate getX509CertFromSslCertHack(SslCertificate sslCert) {

View File

@ -202,11 +202,11 @@ public class ContentBlockerHandler {
if (contentType == null) {
contentType = "text/plain";
} else {
String[] contentTypeSplitted = contentType.split(";");
contentType = contentTypeSplitted[0].trim();
String[] contentTypeSplit = contentType.split(";");
contentType = contentTypeSplit[0].trim();
if (encoding == null) {
encoding = (contentTypeSplitted.length > 1 && contentTypeSplitted[1].contains("charset="))
? contentTypeSplitted[1].replace("charset=", "").trim()
encoding = (contentTypeSplit.length > 1 && contentTypeSplit[1].contains("charset="))
? contentTypeSplit[1].replace("charset=", "").trim()
: "utf-8";
}
}
@ -245,11 +245,11 @@ public class ContentBlockerHandler {
// byte[] dataBytes = response.body().bytes();
// InputStream dataStream = new ByteArrayInputStream(dataBytes);
//
// String[] contentTypeSplitted = response.header("content-type", "text/plain").split(";");
// String[] contentTypeSplit = response.header("content-type", "text/plain").split(";");
//
// String contentType = contentTypeSplitted[0].trim();
// String encoding = (contentTypeSplitted.length > 1 && contentTypeSplitted[1].contains("charset="))
// ? contentTypeSplitted[1].replace("charset=", "").trim()
// String contentType = contentTypeSplit[0].trim();
// String encoding = (contentTypeSplit.length > 1 && contentTypeSplit[1].contains("charset="))
// ? contentTypeSplit[1].replace("charset=", "").trim()
// : "utf-8";
//
// response.body().close();
@ -297,8 +297,8 @@ public class ContentBlockerHandler {
try {
String contentType = urlConnection.getContentType();
if (contentType != null) {
String[] contentTypeSplitted = contentType.split(";");
contentType = contentTypeSplitted[0].trim();
String[] contentTypeSplit = contentType.split(";");
contentType = contentTypeSplit[0].trim();
responseResourceType = getResourceTypeFromContentType(contentType);
}
} catch (Exception e) {

View File

@ -1589,8 +1589,8 @@ class AndroidInAppWebViewController extends PlatformInAppWebViewController
}
if (webviewUrl.isScheme("file")) {
var assetPathSplitted = webviewUrl.toString().split("/flutter_assets/");
var assetPath = assetPathSplitted[assetPathSplitted.length - 1];
var assetPathSplit = webviewUrl.toString().split("/flutter_assets/");
var assetPath = assetPathSplit[assetPathSplit.length - 1];
try {
var bytes = await rootBundle.load(assetPath);
html = utf8.decode(bytes.buffer.asUint8List());
@ -1628,8 +1628,8 @@ class AndroidInAppWebViewController extends PlatformInAppWebViewController
var assetPathBase;
if (webviewUrl.isScheme("file")) {
var assetPathSplitted = webviewUrl.toString().split("/flutter_assets/");
assetPathBase = assetPathSplitted[0] + "/flutter_assets/";
var assetPathSplit = webviewUrl.toString().split("/flutter_assets/");
assetPathBase = assetPathSplit[0] + "/flutter_assets/";
}
InAppWebViewSettings? settings = await getSettings();
@ -1764,8 +1764,8 @@ class AndroidInAppWebViewController extends PlatformInAppWebViewController
: null;
}
if (sizes != null && sizes.isNotEmpty && sizes != "any") {
List<String> sizesSplitted = sizes.split(" ");
for (String size in sizesSplitted) {
List<String> sizesSplit = sizes.split(" ");
for (String size in sizesSplit) {
int width = int.parse(size.split("x")[0]);
int height = int.parse(size.split("x")[1]);
favicons.add(Favicon(

View File

@ -62,8 +62,8 @@ public class InAppBrowserWebViewController: UIViewController, InAppBrowserDelega
channelDelegate = InAppBrowserChannelDelegate(channel: channel)
var userScripts: [UserScript] = []
for intialUserScript in initialUserScripts {
userScripts.append(UserScript.fromMap(map: intialUserScript, windowId: windowId)!)
for initialUserScript in initialUserScripts {
userScripts.append(UserScript.fromMap(map: initialUserScript, windowId: windowId)!)
}
let preWebviewConfiguration = InAppWebView.preWKWebViewConfiguration(settings: webViewSettings)

View File

@ -1,5 +1,5 @@
//
// CustomeSchemeHandler.swift
// CustomSchemeHandler.swift
// flutter_inappwebview
//
// Created by Lorenzo Pichilli on 25/10/2019.

View File

@ -29,8 +29,8 @@ public class FlutterWebViewController: NSObject, FlutterPlatformView, Disposable
var userScripts: [UserScript] = []
if let initialUserScripts = initialUserScripts {
for intialUserScript in initialUserScripts {
userScripts.append(UserScript.fromMap(map: intialUserScript, windowId: windowId)!)
for initialUserScript in initialUserScripts {
userScripts.append(UserScript.fromMap(map: initialUserScript, windowId: windowId)!)
}
}

View File

@ -1982,7 +1982,7 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate,
switch action {
case 0:
InAppWebView.credentialsProposed = []
// used .performDefaultHandling to mantain consistency with Android
// used .performDefaultHandling to maintain consistency with Android
// because .cancelAuthenticationChallenge will call webView(_:didFail:withError:)
completionHandler(.performDefaultHandling, nil)
//completionHandler(.cancelAuthenticationChallenge, nil)

View File

@ -62,7 +62,7 @@ public class InAppWebViewManager: ChannelDelegate {
webViewForUserAgent?.evaluateJavaScript("navigator.userAgent") { (value, error) in
if error != nil {
print("Error occured to get userAgent")
print("Error occurred to get userAgent")
self.webViewForUserAgent = nil
completionHandler(nil)
return

View File

@ -111,7 +111,7 @@ window.\(JAVASCRIPT_BRIDGE_NAME)._findAllAsync = function(keyword) {
);
}
// helper function, recursively removes the highlights in elements and their childs
// helper function, recursively removes the highlights in elements and their children
window.\(JAVASCRIPT_BRIDGE_NAME)._clearMatchesForElement = function(element) {
if (element) {
if (element.nodeType == 1) {

View File

@ -49,7 +49,7 @@ extension URLProtectionSpace {
public func toMap () -> [String:Any?] {
return [
"host": host,
"procotol": self.protocol,
"protocol": self.protocol,
"realm": realm,
"port": port,
"sslCertificate": sslCertificate?.toMap(),

View File

@ -1585,8 +1585,8 @@ class IOSInAppWebViewController extends PlatformInAppWebViewController
}
if (webviewUrl.isScheme("file")) {
var assetPathSplitted = webviewUrl.toString().split("/flutter_assets/");
var assetPath = assetPathSplitted[assetPathSplitted.length - 1];
var assetPathSplit = webviewUrl.toString().split("/flutter_assets/");
var assetPath = assetPathSplit[assetPathSplit.length - 1];
try {
var bytes = await rootBundle.load(assetPath);
html = utf8.decode(bytes.buffer.asUint8List());
@ -1624,8 +1624,8 @@ class IOSInAppWebViewController extends PlatformInAppWebViewController
var assetPathBase;
if (webviewUrl.isScheme("file")) {
var assetPathSplitted = webviewUrl.toString().split("/flutter_assets/");
assetPathBase = assetPathSplitted[0] + "/flutter_assets/";
var assetPathSplit = webviewUrl.toString().split("/flutter_assets/");
assetPathBase = assetPathSplit[0] + "/flutter_assets/";
}
InAppWebViewSettings? settings = await getSettings();
@ -1760,8 +1760,8 @@ class IOSInAppWebViewController extends PlatformInAppWebViewController
: null;
}
if (sizes != null && sizes.isNotEmpty && sizes != "any") {
List<String> sizesSplitted = sizes.split(" ");
for (String size in sizesSplitted) {
List<String> sizesSplit = sizes.split(" ");
for (String size in sizesSplit) {
int width = int.parse(size.split("x")[0]);
int height = int.parse(size.split("x")[1]);
favicons.add(Favicon(

View File

@ -1586,8 +1586,8 @@ class MacOSInAppWebViewController extends PlatformInAppWebViewController
}
if (webviewUrl.isScheme("file")) {
var assetPathSplitted = webviewUrl.toString().split("/flutter_assets/");
var assetPath = assetPathSplitted[assetPathSplitted.length - 1];
var assetPathSplit = webviewUrl.toString().split("/flutter_assets/");
var assetPath = assetPathSplit[assetPathSplit.length - 1];
try {
var bytes = await rootBundle.load(assetPath);
html = utf8.decode(bytes.buffer.asUint8List());
@ -1625,8 +1625,8 @@ class MacOSInAppWebViewController extends PlatformInAppWebViewController
var assetPathBase;
if (webviewUrl.isScheme("file")) {
var assetPathSplitted = webviewUrl.toString().split("/flutter_assets/");
assetPathBase = assetPathSplitted[0] + "/flutter_assets/";
var assetPathSplit = webviewUrl.toString().split("/flutter_assets/");
assetPathBase = assetPathSplit[0] + "/flutter_assets/";
}
InAppWebViewSettings? settings = await getSettings();
@ -1761,8 +1761,8 @@ class MacOSInAppWebViewController extends PlatformInAppWebViewController
: null;
}
if (sizes != null && sizes.isNotEmpty && sizes != "any") {
List<String> sizesSplitted = sizes.split(" ");
for (String size in sizesSplitted) {
List<String> sizesSplit = sizes.split(" ");
for (String size in sizesSplit) {
int width = int.parse(size.split("x")[0]);
int height = int.parse(size.split("x")[1]);
favicons.add(Favicon(

View File

@ -41,8 +41,8 @@ public class InAppBrowserWebViewController: NSViewController, InAppBrowserDelega
channelDelegate = InAppBrowserChannelDelegate(channel: channel)
var userScripts: [UserScript] = []
for intialUserScript in initialUserScripts {
userScripts.append(UserScript.fromMap(map: intialUserScript, windowId: windowId)!)
for initialUserScript in initialUserScripts {
userScripts.append(UserScript.fromMap(map: initialUserScript, windowId: windowId)!)
}
let preWebviewConfiguration = InAppWebView.preWKWebViewConfiguration(settings: webViewSettings)

View File

@ -1,5 +1,5 @@
//
// CustomeSchemeHandler.swift
// CustomSchemeHandler.swift
// flutter_inappwebview
//
// Created by Lorenzo Pichilli on 25/10/2019.

View File

@ -27,8 +27,8 @@ public class FlutterWebViewController: NSObject, /*FlutterPlatformView,*/ Dispos
var userScripts: [UserScript] = []
if let initialUserScripts = initialUserScripts {
for intialUserScript in initialUserScripts {
userScripts.append(UserScript.fromMap(map: intialUserScript, windowId: windowId)!)
for initialUserScript in initialUserScripts {
userScripts.append(UserScript.fromMap(map: initialUserScript, windowId: windowId)!)
}
}

View File

@ -1365,7 +1365,7 @@ public class InAppWebView: WKWebView, WKUIDelegate,
switch action {
case 0:
InAppWebView.credentialsProposed = []
// used .performDefaultHandling to mantain consistency with Android
// used .performDefaultHandling to maintain consistency with Android
// because .cancelAuthenticationChallenge will call webView(_:didFail:withError:)
completionHandler(.performDefaultHandling, nil)
//completionHandler(.cancelAuthenticationChallenge, nil)

View File

@ -63,7 +63,7 @@ public class InAppWebViewManager: ChannelDelegate {
webViewForUserAgent?.evaluateJavaScript("navigator.userAgent") { (value, error) in
if error != nil {
print("Error occured to get userAgent")
print("Error occurred to get userAgent")
self.webViewForUserAgent = nil
completionHandler(nil)
return

View File

@ -111,7 +111,7 @@ window.\(JAVASCRIPT_BRIDGE_NAME)._findAllAsync = function(keyword) {
);
}
// helper function, recursively removes the highlights in elements and their childs
// helper function, recursively removes the highlights in elements and their children
window.\(JAVASCRIPT_BRIDGE_NAME)._clearMatchesForElement = function(element) {
if (element) {
if (element.nodeType == 1) {

View File

@ -49,7 +49,7 @@ extension URLProtectionSpace {
public func toMap () -> [String:Any?] {
return [
"host": host,
"procotol": self.protocol,
"protocol": self.protocol,
"realm": realm,
"port": port,
"sslCertificate": sslCertificate?.toMap(),

View File

@ -261,8 +261,8 @@ class WebPlatformInAppWebViewController extends PlatformInAppWebViewController
}
if (webviewUrl.isScheme("file")) {
var assetPathSplitted = webviewUrl.toString().split("/flutter_assets/");
var assetPath = assetPathSplitted[assetPathSplitted.length - 1];
var assetPathSplit = webviewUrl.toString().split("/flutter_assets/");
var assetPath = assetPathSplit[assetPathSplit.length - 1];
try {
var bytes = await rootBundle.load(assetPath);
html = utf8.decode(bytes.buffer.asUint8List());
@ -291,8 +291,8 @@ class WebPlatformInAppWebViewController extends PlatformInAppWebViewController
var assetPathBase;
if (webviewUrl.isScheme("file")) {
var assetPathSplitted = webviewUrl.toString().split("/flutter_assets/");
assetPathBase = assetPathSplitted[0] + "/flutter_assets/";
var assetPathSplit = webviewUrl.toString().split("/flutter_assets/");
assetPathBase = assetPathSplit[0] + "/flutter_assets/";
}
InAppWebViewSettings? settings = await getSettings();
@ -373,8 +373,8 @@ class WebPlatformInAppWebViewController extends PlatformInAppWebViewController
: null;
}
if (sizes != null && sizes.isNotEmpty && sizes != "any") {
List<String> sizesSplitted = sizes.split(" ");
for (String size in sizesSplitted) {
List<String> sizesSplit = sizes.split(" ");
for (String size in sizesSplit) {
int width = int.parse(size.split("x")[0]);
int height = int.parse(size.split("x")[1]);
favicons.add(Favicon(