Skip to content

Commit 300f3bb

Browse files
committed
fix(webview): Remove normalizeUrl method
1 parent 6cac60f commit 300f3bb

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

src/webview/index.common.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,6 @@ export const isScrollEnabledProperty = new Property<WebViewExtBase, boolean>({
103103
valueConverter: booleanConverter
104104
});
105105

106-
export const normalizeUrlsProperty = new Property<WebViewExtBase, boolean>({
107-
name: 'normalizeUrls',
108-
defaultValue: true,
109-
valueConverter: booleanConverter
110-
});
111-
112106
export const limitsNavigationsToAppBoundDomainsProperty = new Property<WebViewExtBase, boolean>({
113107
name: 'limitsNavigationsToAppBoundDomains',
114108
valueConverter: booleanConverter
@@ -389,7 +383,6 @@ export class UnsupportedSDKError extends Error {
389383
@CSSType('WebView')
390384
export abstract class WebViewExtBase extends ContainerView {
391385
public webConsoleEnabled: boolean;
392-
public normalizeUrls: boolean;
393386

394387
public static readonly supportXLocalScheme: boolean;
395388

@@ -551,7 +544,6 @@ export abstract class WebViewExtBase extends ContainerView {
551544
* Callback for the loadFinished-event. Called from the native-webview
552545
*/
553546
public async _onLoadFinished(url: string, error?: string): Promise<LoadFinishedEventData> {
554-
url = this.normalizeURL(url);
555547
if (Trace.isEnabled()) {
556548
Trace.write(`WebViewExt._onLoadFinished("${url}", ${error || void 0} ${this.autoInjectJSBridge}) - > Injecting webview-bridge JS code`, WebViewTraceCategory, Trace.messageType.info);
557549
}
@@ -857,8 +849,6 @@ export abstract class WebViewExtBase extends ContainerView {
857849
}
858850

859851
if (lcSrc.startsWith(this.interceptScheme) || lcSrc.startsWith('http://') || lcSrc.startsWith('https://') || lcSrc.startsWith('file:///')) {
860-
src = this.normalizeURL(src);
861-
862852
if (originSrc !== src) {
863853
// Make sure the src-property reflects the actual value.
864854
try {
@@ -1115,17 +1105,6 @@ export abstract class WebViewExtBase extends ContainerView {
11151105
this.autoInjectJavaScriptBlocks = this.autoInjectJavaScriptBlocks.filter((data) => data.name !== name);
11161106
}
11171107

1118-
public normalizeURL(url: string): string {
1119-
if (!url || !this.normalizeUrls || url.startsWith(this.interceptScheme)) {
1120-
return url;
1121-
}
1122-
try {
1123-
return require('url').parse(url).format();
1124-
} catch (error) {
1125-
return url;
1126-
}
1127-
}
1128-
11291108
/**
11301109
* Ensure fetch-api is available.
11311110
*/
@@ -1588,7 +1567,6 @@ cacheModeProperty.register(WebViewExtBase);
15881567
databaseStorageProperty.register(WebViewExtBase);
15891568
debugModeProperty.register(WebViewExtBase);
15901569
webConsoleProperty.register(WebViewExtBase);
1591-
normalizeUrlsProperty.register(WebViewExtBase);
15921570
displayZoomControlsProperty.register(WebViewExtBase);
15931571
domStorageProperty.register(WebViewExtBase);
15941572
srcProperty.register(WebViewExtBase);

0 commit comments

Comments
 (0)