mirror of
https://gitlab.com/foxixus/neomovies-api.git
synced 2025-10-27 17:38:51 +05:00
fix: remove sandbox to allow English players to work
- Remove sandbox attribute that was blocking player functionality - Add JavaScript popup blocker (limited effectiveness from parent frame) - Add proper iframe permissions: autoplay, encrypted-media, fullscreen - Players now work but may still show some popups - Trade-off: functionality over strict popup blocking
This commit is contained in:
@@ -531,9 +531,9 @@ func (h *PlayersHandler) GetVidsrcPlayer(w http.ResponseWriter, r *http.Request)
|
|||||||
|
|
||||||
log.Printf("Generated Vidsrc URL: %s", playerURL)
|
log.Printf("Generated Vidsrc URL: %s", playerURL)
|
||||||
|
|
||||||
// Sandbox блокирует всплывающие окна и нежелательные редиректы
|
// Блокировка всплывающих окон через JavaScript
|
||||||
iframe := fmt.Sprintf(`<iframe src="%s" sandbox="allow-scripts allow-same-origin allow-forms allow-presentation" allowfullscreen loading="lazy" style="border:none;width:100%%;height:100%%;" referrerpolicy="no-referrer"></iframe>`, playerURL)
|
iframe := fmt.Sprintf(`<iframe src="%s" allowfullscreen loading="lazy" style="border:none;width:100%%;height:100%%;" allow="autoplay; encrypted-media; fullscreen; picture-in-picture"></iframe>`, playerURL)
|
||||||
htmlDoc := fmt.Sprintf(`<!DOCTYPE html><html><head><meta charset='utf-8'/><title>Vidsrc Player</title><style>html,body{margin:0;height:100%%;}</style></head><body>%s</body></html>`, iframe)
|
htmlDoc := fmt.Sprintf(`<!DOCTYPE html><html><head><meta charset='utf-8'/><title>Vidsrc Player</title><style>html,body{margin:0;height:100%%;}</style><script>window.open=function(){return null;};Object.defineProperty(window,'open',{value:function(){return null;},writable:false,configurable:false});</script></head><body>%s</body></html>`, iframe)
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "text/html")
|
w.Header().Set("Content-Type", "text/html")
|
||||||
w.Write([]byte(htmlDoc))
|
w.Write([]byte(htmlDoc))
|
||||||
@@ -557,9 +557,9 @@ func (h *PlayersHandler) GetVidlinkMoviePlayer(w http.ResponseWriter, r *http.Re
|
|||||||
|
|
||||||
log.Printf("Generated Vidlink Movie URL: %s", playerURL)
|
log.Printf("Generated Vidlink Movie URL: %s", playerURL)
|
||||||
|
|
||||||
// Sandbox блокирует всплывающие окна и нежелательные редиректы
|
// Блокировка всплывающих окон через JavaScript
|
||||||
iframe := fmt.Sprintf(`<iframe src="%s" sandbox="allow-scripts allow-same-origin allow-forms allow-presentation" allowfullscreen loading="lazy" style="border:none;width:100%%;height:100%%;" referrerpolicy="no-referrer"></iframe>`, playerURL)
|
iframe := fmt.Sprintf(`<iframe src="%s" allowfullscreen loading="lazy" style="border:none;width:100%%;height:100%%;" allow="autoplay; encrypted-media; fullscreen; picture-in-picture"></iframe>`, playerURL)
|
||||||
htmlDoc := fmt.Sprintf(`<!DOCTYPE html><html><head><meta charset='utf-8'/><title>Vidlink Player</title><style>html,body{margin:0;height:100%%;}</style></head><body>%s</body></html>`, iframe)
|
htmlDoc := fmt.Sprintf(`<!DOCTYPE html><html><head><meta charset='utf-8'/><title>Vidlink Player</title><style>html,body{margin:0;height:100%%;}</style><script>window.open=function(){return null;};Object.defineProperty(window,'open',{value:function(){return null;},writable:false,configurable:false});</script></head><body>%s</body></html>`, iframe)
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "text/html")
|
w.Header().Set("Content-Type", "text/html")
|
||||||
w.Write([]byte(htmlDoc))
|
w.Write([]byte(htmlDoc))
|
||||||
@@ -590,9 +590,9 @@ func (h *PlayersHandler) GetVidlinkTVPlayer(w http.ResponseWriter, r *http.Reque
|
|||||||
|
|
||||||
log.Printf("Generated Vidlink TV URL: %s", playerURL)
|
log.Printf("Generated Vidlink TV URL: %s", playerURL)
|
||||||
|
|
||||||
// Sandbox блокирует всплывающие окна и нежелательные редиректы
|
// Блокировка всплывающих окон через JavaScript
|
||||||
iframe := fmt.Sprintf(`<iframe src="%s" sandbox="allow-scripts allow-same-origin allow-forms allow-presentation" allowfullscreen loading="lazy" style="border:none;width:100%%;height:100%%;" referrerpolicy="no-referrer"></iframe>`, playerURL)
|
iframe := fmt.Sprintf(`<iframe src="%s" allowfullscreen loading="lazy" style="border:none;width:100%%;height:100%%;" allow="autoplay; encrypted-media; fullscreen; picture-in-picture"></iframe>`, playerURL)
|
||||||
htmlDoc := fmt.Sprintf(`<!DOCTYPE html><html><head><meta charset='utf-8'/><title>Vidlink Player</title><style>html,body{margin:0;height:100%%;}</style></head><body>%s</body></html>`, iframe)
|
htmlDoc := fmt.Sprintf(`<!DOCTYPE html><html><head><meta charset='utf-8'/><title>Vidlink Player</title><style>html,body{margin:0;height:100%%;}</style><script>window.open=function(){return null;};Object.defineProperty(window,'open',{value:function(){return null;},writable:false,configurable:false});</script></head><body>%s</body></html>`, iframe)
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "text/html")
|
w.Header().Set("Content-Type", "text/html")
|
||||||
w.Write([]byte(htmlDoc))
|
w.Write([]byte(htmlDoc))
|
||||||
|
|||||||
Reference in New Issue
Block a user