@@ -122,12 +122,12 @@ class RequestInspectorJavaScriptInterface(webView: WebView, val matcher: Request
122122
123123 @JavascriptInterface
124124 fun getAdditionalHeaders (url : String ): String {
125- return matcher.additionalHeaders (url).toString()
125+ return matcher.getAdditionalHeaders (url).toString()
126126 }
127127
128128 @JavascriptInterface
129129 fun getAdditionalQueryParam (): String {
130- return matcher.getAdditionalQueryParam ()
130+ return matcher.getAdditionalQueryParams ()
131131 }
132132
133133 private fun addRecordedRequest (recordedRequest : RecordedRequest ) {
@@ -256,7 +256,7 @@ function getFullUrl(url) {
256256 }
257257}
258258
259- function appendAdditionalQueryParam (url) {
259+ function appendAdditionalQueryParams (url) {
260260 try {
261261 var extraQueryParam = $INTERFACE_NAME .getAdditionalQueryParam();
262262 if (extraQueryParam) {
@@ -266,7 +266,9 @@ function appendAdditionalQueryParam(url) {
266266 url += '&' + extraQueryParam;
267267 }
268268 }
269- } catch (e) { console.warn('Failed to inject query param from Kotlin:', e); }
269+ } catch (e) {
270+ console.warn('Failed to inject query param from Kotlin:', e);
271+ }
270272 return url;
271273}
272274
@@ -290,7 +292,7 @@ function recordFormSubmission(form) {
290292
291293 const path = form.attributes['action'] === undefined ? "/" : form.attributes['action'].nodeValue;
292294 const method = form.attributes['method'] === undefined ? "GET" : form.attributes['method'].nodeValue;
293- const url = appendAdditionalQueryParam (getFullUrl(path));
295+ const url = appendAdditionalQueryParams (getFullUrl(path));
294296 const encType = form.attributes['enctype'] === undefined ? "application/x-www-form-urlencoded" : form.attributes['enctype'].nodeValue;
295297 const err = new Error();
296298 $INTERFACE_NAME .recordFormSubmission(
@@ -322,7 +324,7 @@ let xmlhttpRequestUrl = null;
322324XMLHttpRequest.prototype._open = XMLHttpRequest.prototype.open;
323325XMLHttpRequest.prototype.open = function (method, url, async, user, password) {
324326 lastXmlhttpRequestPrototypeMethod = method;
325- xmlhttpRequestUrl = appendAdditionalQueryParam (url);
327+ xmlhttpRequestUrl = appendAdditionalQueryParams (url);
326328 const asyncWithDefault = async === undefined ? true : async;
327329 this._open(method, xmlhttpRequestUrl, asyncWithDefault, user, password);
328330};
@@ -364,7 +366,7 @@ window.fetch = function () {
364366 const firstArgument = arguments[0];
365367 let url, method, body, headers;
366368 if (typeof firstArgument === 'string') {
367- url = appendAdditionalQueryParam (firstArgument);
369+ url = appendAdditionalQueryParams (firstArgument);
368370 if (!arguments[1]) arguments[1] = {};
369371 method = arguments[1] && 'method' in arguments[1] ? arguments[1]['method'] : "GET";
370372 body = arguments[1] && 'body' in arguments[1] ? arguments[1]['body'] : "";
@@ -379,7 +381,7 @@ window.fetch = function () {
379381 arguments[0] = url;
380382 } else {
381383 // Request object
382- url = appendAdditionalQueryParam (firstArgument.url);
384+ url = appendAdditionalQueryParams (firstArgument.url);
383385 method = firstArgument.method;
384386 body = firstArgument.body;
385387 headers = Object.fromEntries(firstArgument.headers.entries());
0 commit comments