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:
Submodule plugins/replication updated: 08862c0600...5e91925cfd
@@ -449,8 +449,10 @@
|
||||
};
|
||||
|
||||
Gerrit.install = function(callback, opt_version, opt_src) {
|
||||
const src = opt_src || (document.currentScript &&
|
||||
(document.currentScript.src || document.currentScript.baseURI));
|
||||
// HTML import polyfill adds __importElement pointing to the import tag.
|
||||
const script = document.currentScript &&
|
||||
(document.currentScript.__importElement || document.currentScript);
|
||||
const src = opt_src || (script && (script.src || script.baseURI));
|
||||
const name = getPluginNameFromUrl(src);
|
||||
|
||||
if (opt_version && opt_version !== API_VERSION) {
|
||||
|
Reference in New Issue
Block a user