Skip to content

Commit

Permalink
fix: remove location.search calls from SMP plugin (#730)
Browse files Browse the repository at this point in the history
* fix: prevents location.search calls from plugin

* chore: bumps version to 1.4.5
  • Loading branch information
andy-brown authored Mar 11, 2024
1 parent 628c0d6 commit aed18cc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/storyplayer",
"version": "1.4.4",
"version": "1.4.5",
"description": "StoryPlayer - reference player for BBC Research & Development's object-based media schema (https://www.npmjs.com/package/@bbc/object-based-media-schema)",
"main": "./dist/storyplayer.js",
"module": "./dist/storyplayer.js",
Expand Down
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 aed18cc

Please sign in to comment.