Prefer Tampermonkey requests for Suno APIs

This commit is contained in:
DESKTOP-KSVGT20\shkim
2026-05-02 01:05:18 +09:00
parent cbe6623d66
commit 0cdb412ef5
+5 -2
View File
@@ -1,7 +1,7 @@
// ==UserScript==
// @name ChatGPT to Suno Prompt Copier
// @namespace local.suno-helper
// @version 0.8.4
// @version 0.8.5
// @description Copy structured ChatGPT song prompt versions into Suno fields.
// @author local
// @match https://chatgpt.com/*
@@ -28,7 +28,7 @@
(function () {
"use strict";
const SCRIPT_VERSION = "0.8.4";
const SCRIPT_VERSION = "0.8.5";
const STORAGE_KEY = "chatgptSunoPromptSlots";
const SLOT_COUNT = 2;
const isChatGPT = location.hostname.includes("chatgpt.com") || location.hostname.includes("chat.openai.com");
@@ -864,6 +864,9 @@
...(options.method && options.method !== "GET" && options.method !== "HEAD" ? { "content-type": "application/json" } : {}),
...(options.headers || {}),
};
if (typeof GM_xmlhttpRequest === "function" && /^https?:\/\/[^/]*suno\./i.test(url)) {
return callTampermonkeyRequest(url, { ...options, headers });
}
try {
const response = await page.fetch(url, {
credentials: "include",