Skip to content

Commit

Permalink
fix: prevents location.search calls from plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-brown committed Feb 5, 2024
1 parent 628c0d6 commit 4227228
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/gui/Player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,8 @@ class Player extends EventEmitter {

this.useExternalTransport = () => {
// eslint-disable-next-line no-restricted-globals
const useExternal =
new URLSearchParams(parent.location.search).getAll("noUi")
.length > 0 || this._controller.options?.noUi
const useExternal =
getSetting("noUi") === "true" || this._controller.options?.noUi
if (useExternal === undefined) return false
return useExternal
}
Expand Down
1 change: 1 addition & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export const getCurrentUrl = () => {
return window.location.href
}
export const getVariableOverrides = () => {
if (inSMPWrapper) return [];
const varNames = new URLSearchParams(window.location.search).getAll(
"varName",
)
Expand Down

0 comments on commit 4227228

Please sign in to comment.