Correct location string

Former-commit-id: 65a4c1e9a59bfab78ce0a374b24cd270a52f8a30 [formerly 6d6554b8576ad72b09c4649c1b7bcffe157034c3]
Former-commit-id: d5ad4c5121bcb5e665d98817319bdfaa1c7f1c17
This commit is contained in:
Jaifroid 2020-01-19 13:11:51 +00:00
parent 5eb89721ff
commit 130b423c26
2 changed files with 3 additions and 3 deletions

View File

@ -1130,7 +1130,7 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'utf8', 'images', 'cooki
var determinedWikiTheme = params.cssTheme == 'auto' ? cssUIThemeGetOrSet('auto', true) : params.cssTheme;
var breakoutLink = doc.getElementById('breakoutLink');
// Construct an absolute reference becuase Service Worker needs this
var prefix = document.location.origin + document.location.pathname.replace(/\/[^/]*$/, '');
var prefix = (window.location.protocol + '//' + window.location.host + window.location.pathname).replace(/\/[^/]*$/, '');
if (determinedWikiTheme != "light") {
var link = doc.createElement("link");
link.setAttribute("rel", "stylesheet");
@ -2838,7 +2838,7 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'utf8', 'images', 'cooki
//Preload stylesheets [kiwix-js #149]
//Set up blobArray of promises
var prefix = document.location.origin + document.location.pathname.replace(/\/[^/]*$/, '');
var prefix = (window.location.protocol + '//' + window.location.host + window.location.pathname).replace(/\/[^/]*$/, '');
var cssArray = htmlArticle.match(regexpSheetHref);
var blobArray = [];
var cssSource = params.cssSource;

View File

@ -24,7 +24,7 @@
'use strict';
define(['util', 'uiUtil'], function (util, uiUtil) {
var prefix = document.location.origin + document.location.pathname.replace(/\/[^/]*$/, '/');
var prefix = (window.location.protocol + '//' + window.location.host + window.location.pathname).replace(/\/[^/]*$/, '/');
/* zl = zimLink; zim = zimType; cc = cssCache; cs = cssSource; i] */
function filterCSS(zl, zim, cc, cs, i) {
var rtnFunction = "injectCSS";