Skip to content

Commit

Permalink
Fix #1 the wgServer with protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederisk committed Sep 15, 2021
1 parent 04d7373 commit ff750f5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ jQuery.when(window.mw.loader.using('mediawiki.util'), $.ready).then((): void =>
const args: Record<string, string> = {
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')
};
Expand All @@ -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,
Expand Down

0 comments on commit ff750f5

Please sign in to comment.