Skip to content

Commit 7d84d6b

Browse files
Perry Mitchellperry-mitchell
Perry Mitchell
authored andcommitted
Use 'document.scripts' instead of document.getElementsByTagName
1 parent 0897b4d commit 7d84d6b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

client/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if (typeof __resourceQuery === "string" && __resourceQuery) {
77
urlParts = url.parse(__resourceQuery.substr(1));
88
} else {
99
// Else, get the url from the <script> this file was called with.
10-
var scriptElements = document.getElementsByTagName("script");
10+
var scriptElements = document.scripts;
1111
var scriptHost = scriptElements[scriptElements.length-1].getAttribute("src");
1212
scriptHost = scriptHost && scriptHost.replace(/\/[^\/]+$/, "");
1313
urlParts = url.parse((scriptHost ? scriptHost : "/"), false, true);

0 commit comments

Comments
 (0)