1. Install ekstensi Tampermonkey di browser kamu.
2. Buat script baru, copas kode di bawah ini, lalu Save.
// ==UserScript==
// @name SubSource CORS Bypass
// @namespace https://viayoo.com/t5edxi
// @version 0.1
// @description Bypass CORS untuk web SubSource
// @author Rizkym
// @run-at document-end
// @match https://sub.rizkym.my.id/*
// @grant GM_xmlhttpRequest
// @grant unsafeWindow
// @connect api.subsource.net
// ==/UserScript==
unsafeWindow.gmFetch = function(url, options) {
return new Promise((resolve, reject) => {
const isDownload = url.includes('/download');
GM_xmlhttpRequest({
method: options?.method || "GET",
url: url,
headers: options?.headers || {},
responseType: isDownload ? "blob" : "text",
onload: function(res) {
resolve({
json: async () => JSON.parse(res.responseText),
blob: async () => res.response
});
},
onerror: function(err) { reject(err); }
});
});
};