From ff750f59a78aa2d1a015a70c2630157eaaa9aaed Mon Sep 17 00:00:00 2001 From: Rowe Wilson Frederisk Holme Date: Wed, 15 Sep 2021 18:02:23 +0800 Subject: [PATCH] Fix #1 the wgServer with protocol --- src/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index c287232..f0b25a2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -22,7 +22,8 @@ jQuery.when(window.mw.loader.using('mediawiki.util'), $.ready).then((): void => const args: Record = { RemoteBot: 'true', TransferProtocol: window.location.protocol, - SiteHost: window.mw.config.get('wgServer'), + // 'https://host' => '//host': https://www.mediawiki.org/wiki/Manual:$wgServer + SiteHost: window.mw.config.get('wgServer').replace(/[a-z]*?:(?=\/\/)/, ''), APIPath: window.mw.util.wikiScript('api'), Title: window.mw.config.get('wgPageName') }; @@ -31,7 +32,7 @@ jQuery.when(window.mw.loader.using('mediawiki.util'), $.ready).then((): void => window.mw.util.addPortletLink( isMinerva ? 'p-tb' : 'p-views', - `${scheme}${extensionID}${actionPath}?${new URLSearchParams(args).toString()}`, + `${scheme}://${extensionID}${actionPath}?${new URLSearchParams(args).toString()}`, text, gadgetID, tooltip,