aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-10-11 11:13:06 +0200
committerChocobozzz <me@florianbigard.com>2021-10-11 11:13:27 +0200
commitbdb1dfc17653ca327c2656922a651762fd222a24 (patch)
treefbc175cab61f6147dabeccaee889c00da48c2a17 /shared
parent9b513232ac916e963a3ad85a0cef777638143b70 (diff)
downloadPeerTube-bdb1dfc17653ca327c2656922a651762fd222a24.tar.gz
PeerTube-bdb1dfc17653ca327c2656922a651762fd222a24.tar.zst
PeerTube-bdb1dfc17653ca327c2656922a651762fd222a24.zip
Safer iframe creation
Diffstat (limited to 'shared')
-rw-r--r--shared/core-utils/common/url.ts13
1 files changed, 2 insertions, 11 deletions
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: {
53}) { 53}) {
54 const { url } = options 54 const { url } = options
55 55
56 const params = generateParams(window.location.search) 56 const params = new URLSearchParams()
57 57
58 if (options.startTime !== undefined && options.startTime !== null) { 58 if (options.startTime !== undefined && options.startTime !== null) {
59 const startTimeInt = Math.floor(options.startTime) 59 const startTimeInt = Math.floor(options.startTime)
@@ -85,7 +85,7 @@ function decoratePlaylistLink (options: {
85}) { 85}) {
86 const { url } = options 86 const { url } = options
87 87
88 const params = generateParams(window.location.search) 88 const params = new URLSearchParams()
89 89
90 if (options.playlistPosition) params.set('playlistPosition', '' + options.playlistPosition) 90 if (options.playlistPosition) params.set('playlistPosition', '' + options.playlistPosition)
91 91
@@ -119,12 +119,3 @@ function buildUrl (url: string, params: URLSearchParams) {
119 119
120 return url 120 return url
121} 121}
122
123function generateParams (url: string) {
124 const params = new URLSearchParams(window.location.search)
125 // Unused parameters in embed
126 params.delete('videoId')
127 params.delete('resume')
128
129 return params
130}