Skip to content

Commit

Permalink
fix: detection automatic public path
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Apr 23, 2023
1 parent 19a123d commit 308ee42
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/runtime/AutoPublicPathRuntimeModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ class AutoPublicPathRuntimeModule extends RuntimeModule {
"if (!scriptUrl) {",
Template.indent([
'var scripts = document.getElementsByTagName("script");',
"if(scripts.length) scriptUrl = scripts[scripts.length - 1].src"
"if(scripts.length) {",
Template.indent([
"var i = scripts.length - 1;",
"while (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src;"
]),
"}"
]),
"}"
]),
Expand Down

0 comments on commit 308ee42

Please sign in to comment.