diff --git a/chatgpt-suno-tampermonkey.user.js b/chatgpt-suno-tampermonkey.user.js index d3acf98..15ee523 100644 --- a/chatgpt-suno-tampermonkey.user.js +++ b/chatgpt-suno-tampermonkey.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name ChatGPT to Suno Prompt Copier // @namespace local.suno-helper -// @version 0.9.8 +// @version 0.9.9 // @description Copy structured ChatGPT song prompt versions into Suno fields. // @author local // @match https://chatgpt.com/* @@ -30,7 +30,7 @@ (function () { "use strict"; - const SCRIPT_VERSION = "0.9.8"; + const SCRIPT_VERSION = "0.9.9"; const STORAGE_KEY = "chatgptSunoPromptSlots"; const SLOT_COUNT = 2; const isChatGPT = location.hostname.includes("chatgpt.com") || location.hostname.includes("chat.openai.com"); @@ -75,15 +75,18 @@ const originalFetch = page.fetch; if (typeof originalFetch === "function") { - page.fetch = async function (...args) { - const response = await originalFetch.apply(this, args); - const url = args[0]?.url || args[0] || response.url || ""; - if (/suno/i.test(String(url))) { - response.clone().text().then((text) => { - rememberSunoResponse(url, tryParseJson(text) || text); - }).catch(() => {}); - } - return response; + page.fetch = function (...args) { + const result = originalFetch.apply(this, args); + result.then((response) => { + const url = args[0]?.url || args[0] || response.url || ""; + const urlText = String(url); + if (/suno/i.test(urlText) && !/agg-receiver-service|datadoghq|braze|sprig|cloudflareinsights/i.test(urlText)) { + response.clone().text().then((text) => { + rememberSunoResponse(url, tryParseJson(text) || text); + }).catch(() => {}); + } + }).catch(() => {}); + return result; }; } @@ -1814,15 +1817,15 @@
- +
- +
- +
@@ -2035,7 +2038,7 @@ }; body.querySelector("[data-cgs-process-one-mp3]").addEventListener("click", async () => { - await processSelectedTrack("mp3"); + await clickSelectedSunoUiDownloads("mp3", { one: true }); }); body.querySelector("[data-cgs-process-one-wav]").addEventListener("click", async () => { @@ -2043,7 +2046,7 @@ }); body.querySelector("[data-cgs-process-selected-mp3]").addEventListener("click", async () => { - await processSelectedTracks("mp3"); + await clickSelectedSunoUiDownloads("mp3"); }); body.querySelector("[data-cgs-process-selected-wav]").addEventListener("click", async () => {