diff --git a/qtm-live-mixed-content.user.js b/qtm-live-mixed-content.user.js new file mode 100644 index 0000000..e166f55 --- /dev/null +++ b/qtm-live-mixed-content.user.js @@ -0,0 +1,441 @@ +// ==UserScript== +// @name QTM Live — Allow Mixed Content +// @namespace https://th-live.online +// @version 0.5 +// @description Allows live streams served over plain http:// to play on +// QTM-platform pages (which are served over https://). +// Because the stream servers do not support HTTPS, URL-upgrading +// cannot be used. Every http:// XMLHttpRequest and fetch() call +// made by the player (hls.js loads .m3u8 manifests and .ts +// segments this way) is transparently routed through +// GM_xmlhttpRequest, which runs in the extension context and is +// not subject to the browser's mixed-content policy. +// +// v0.3: On Chromium-based browsers (Chrome, Edge, Brave) running +// Tampermonkey, the userscript sandbox runs in an isolated V8 +// world that is separate from the page's own JavaScript context. +// Assigning a ProxiedXHR class directly to unsafeWindow. +// XMLHttpRequest does not work because Chrome prevents +// cross-world constructor invocation. +// +// Fix: the XHR/fetch interception shim is serialised as a string +// and injected into the page world via an inline