From bdb1dfc17653ca327c2656922a651762fd222a24 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 11 Oct 2021 11:13:06 +0200 Subject: Safer iframe creation --- shared/core-utils/common/url.ts | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'shared/core-utils') diff --git a/shared/core-utils/common/url.ts b/shared/core-utils/common/url.ts index 52ed247c4..9c111cbcc 100644 --- a/shared/core-utils/common/url.ts +++ b/shared/core-utils/common/url.ts @@ -53,7 +53,7 @@ function decorateVideoLink (options: { }) { const { url } = options - const params = generateParams(window.location.search) + const params = new URLSearchParams() if (options.startTime !== undefined && options.startTime !== null) { const startTimeInt = Math.floor(options.startTime) @@ -85,7 +85,7 @@ function decoratePlaylistLink (options: { }) { const { url } = options - const params = generateParams(window.location.search) + const params = new URLSearchParams() if (options.playlistPosition) params.set('playlistPosition', '' + options.playlistPosition) @@ -119,12 +119,3 @@ function buildUrl (url: string, params: URLSearchParams) { return url } - -function generateParams (url: string) { - const params = new URLSearchParams(window.location.search) - // Unused parameters in embed - params.delete('videoId') - params.delete('resume') - - return params -} -- cgit v1.2.3