Fix plugin loading in browsers that use polyfill for HTML imports
HTML Imports polyfill resolves document.currentScript in a way that requires additional handling to determine URL of the loaded script. With this change, __importElement is used to locate HTML import node to determine original plugin URL. Bug: Issue 8647 Change-Id: Ibf6d63ab32d3b2f55272cae21b5891562f46d37a
This commit is contained in:
parent
935b4e9ad0
commit
06ee72b7db
|
@ -1 +1 @@
|
||||||
Subproject commit 08862c06001ff24892c5459ead7ebf738893d664
|
Subproject commit 5e91925cfd391898e8e33fd149b9e1a115dafee4
|
|
@ -449,8 +449,10 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
Gerrit.install = function(callback, opt_version, opt_src) {
|
Gerrit.install = function(callback, opt_version, opt_src) {
|
||||||
const src = opt_src || (document.currentScript &&
|
// HTML import polyfill adds __importElement pointing to the import tag.
|
||||||
(document.currentScript.src || document.currentScript.baseURI));
|
const script = document.currentScript &&
|
||||||
|
(document.currentScript.__importElement || document.currentScript);
|
||||||
|
const src = opt_src || (script && (script.src || script.baseURI));
|
||||||
const name = getPluginNameFromUrl(src);
|
const name = getPluginNameFromUrl(src);
|
||||||
|
|
||||||
if (opt_version && opt_version !== API_VERSION) {
|
if (opt_version && opt_version !== API_VERSION) {
|
||||||
|
|
Loading…
Reference in New Issue