Make sure URL constructor is available in non-window environment
This commit is contained in:
parent
ae14d433f9
commit
c3c0b363c1
1 changed files with 6 additions and 1 deletions
|
@ -458,7 +458,12 @@ Zotero.Proxy.prototype.erase = Zotero.Promise.coroutine(function* () {
|
|||
Zotero.Proxy.prototype.toProper = function(m) {
|
||||
if (!Array.isArray(m)) {
|
||||
// make sure url has a trailing slash
|
||||
m = new URL(m).href;
|
||||
if (typeof URL === 'undefined') {
|
||||
m = new (Services.wm.getMostRecentWindow("navigator:browser")).URL(m).href;
|
||||
}
|
||||
else {
|
||||
m = new URL(m).href;
|
||||
}
|
||||
let match = this.regexp.exec(m);
|
||||
if (!match) {
|
||||
return m
|
||||
|
|
Loading…
Reference in a new issue