]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/core-utils/common/url.ts
Safer iframe creation
[github/Chocobozzz/PeerTube.git] / shared / core-utils / common / url.ts
index 52ed247c437a0e1f20ba8c3d38f9108de394e7c1..9c111cbcc32fee117f675922932ed720d7721824 100644 (file)
@@ -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
-}