UNPKG

1.16 kBJavaScriptView Raw
1/**
2@license
3Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
4This code may only be used under the BSD style license found at
5http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
6http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
7found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
8part of the polymer project is also subject to an additional IP rights grant
9found at http://polymer.github.io/PATENTS.txt
10*/
11// Implement Node.baseURI for IE 11
12// adapted from
13// https://github.com/webcomponents/html-imports/blob/v1.2.0/src/html-imports.js
14const native_baseURI = Object.getOwnPropertyDescriptor(Node.prototype, 'baseURI');
15if (!native_baseURI) {
16 Object.defineProperty(Node.prototype, 'baseURI', {
17 get() {
18 // this.ownerDocument is `null` for documents
19 const doc = this.ownerDocument || this;
20 const base = doc.querySelector('base[href]');
21 return base && base.href || window.location.href;
22 },
23 configurable: true,
24 enumerable: true
25 });
26}
27//# sourceMappingURL=baseuri.js.map
\No newline at end of file