Enable ChatGPT Mobile

在桌面浏览器上启用ChatGPT移动版本

  1. /*
  2. MIT License
  3. Copyright 2023 CY Fung
  4. Permission is hereby granted, free of charge, to any person obtaining a copy
  5. of this software and associated documentation files (the "Software"), to deal
  6. in the Software without restriction, including without limitation the rights
  7. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. copies of the Software, and to permit persons to whom the Software is
  9. furnished to do so, subject to the following conditions:
  10. The above copyright notice and this permission notice shall be included in all
  11. copies or substantial portions of the Software.
  12. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  18. SOFTWARE.
  19. */
  20. /*
  21.  
  22. ================================= Disclaimer =================================
  23.  
  24. Note: Before installing the "Enable ChatGPT Mobile" userscript, please be aware that the script is solely intended to enable the mobile version of ChatGPT in desktop browsers. While the userscript enhances the functionality of the ChatGPT website, it does not control or guarantee the availability, performance, or specific features of the mobile models implemented by OpenAI.
  25.  
  26. OpenAI may introduce updates, modifications, or discontinuations to the mobile models or features without prior notice. As a result, the behavior, capabilities, and performance of the mobile models enabled by this userscript may vary and may not meet your specific expectations or requirements.
  27.  
  28. Please keep in mind that this userscript is an independent implementation designed to enable mobile features. OpenAI is responsible for the original ChatGPT platform, its models, and the overall user experience. Any concerns or feedback regarding the behavior or performance of the mobile models should be directed to OpenAI for further assistance.
  29.  
  30. By installing and using the "Enable ChatGPT Mobile" userscript, you acknowledge and understand that OpenAI's implementation of mobile models and features is beyond the control of this userscript, and you accept any risks or limitations associated with the functionality provided.
  31.  
  32. Proceed with the installation of this userscript only if you agree to the terms and conditions mentioned above.
  33.  
  34. ==============================================================================
  35.  
  36. */
  37. // ==UserScript==
  38. // @name Enable ChatGPT Mobile
  39. // @namespace http://tampermonkey.net/
  40. // @version 0.2.2
  41. // @license MIT
  42. // @author CY Fung
  43. // @match https://chat.openai.com/*
  44. // @icon https://www.google.com/s2/favicons?sz=64&domain=openai.com
  45. // @grant unsafeWindow
  46. // @run-at document-start
  47.  
  48. // @description To enable mobile version of ChatGPT in desktop browsers
  49. // @description:ja デスクトップブラウザでChatGPTモバイル版を有効にする
  50. // @description:zh-TW 在桌面瀏覽器上啟用ChatGPT行動版
  51. // @description:zh-CN 在桌面浏览器上启用ChatGPT移动版本
  52.  
  53. // @description:ko 데스크톱 브라우저에서 ChatGPT 모바일 버전 활성화
  54. // @description:ru Включение мобильной версии ChatGPT в браузерах для компьютера
  55. // @description:af Aktiveer ChatGPT Mobile op rekenaarblaaier
  56. // @description:az Masaüstü brauzerlərdə ChatGPT Mobile versiyasını aktivləşdirin
  57. // @description:id Mengaktifkan versi mobile ChatGPT di browser desktop
  58. // @description:ms Mengaktifkan versi mudah alih ChatGPT di pelayar desktop
  59. // @description:bs Aktivirajte mobilnu verziju ChatGPT-a u desktop preglednicima
  60. // @description:ca Activar la versió mòbil de ChatGPT en navegadors d'escriptori
  61. // @description:cs Povolení mobilní verze ChatGPT v desktopových prohlížečích
  62. // @description:da Aktivér mobilversionen af ChatGPT i desktop-browsere
  63. // @description:de Aktivieren Sie die mobile Version von ChatGPT in Desktop-Browsern
  64. // @description:et Luba ChatGPT mobiiliversioon töölauabrauserites
  65. // @description:es Habilitar la versión móvil de ChatGPT en navegadores de escritorio
  66. // @description:eu Gaitu ChatGPT Mobile-ren bertsioa mahaigaineko nabigatzaileetan
  67. // @description:fr Activer la version mobile de ChatGPT dans les navigateurs de bureau
  68. // @description:gl Activar a versión móbil de ChatGPT nos navegadores de escritorio
  69. // @description:hr Omogućite mobilnu verziju ChatGPT-a u preglednicima za stolna računala
  70. // @description:zu Vumela ukuqalisa i-versi ye-ChatGPT Mobile kumakhompyutha we-deskithophu
  71. // @description:is Virkjaðu ChatGPT Mobile-útgáfu í tölvuvafrum
  72. // @description:it Attiva la versione mobile di ChatGPT nei browser per desktop
  73. // @description:sw Wezesha toleo la ChatGPT Mobile kwenye vivinjari vya kompyuta
  74. // @description:lv Iespējot ChatGPT Mobile versiju datora pārlūkprogrammās
  75. // @description:lt Įgalinkite „ChatGPT Mobile“ versiją darbalaukio naršyklėse
  76. // @description:hu Engedélyezze a ChatGPT Mobile verziót asztali böngészőkben
  77. // @description:nl Schakel de mobiele versie van ChatGPT in op desktopbrowsers
  78. // @description:uz Desktop brauzerlarda ChatGPT Mobile versiyasini yoqish
  79. // @description:pl Włącz wersję mobilną ChatGPT w przeglądarkach na komputery
  80. // @description:pt Ative a versão móvel do ChatGPT nos navegadores de desktop
  81. // @description:pt-BR Ative a versão móvel do ChatGPT em navegadores de desktop
  82. // @description:ro Activează versiunea mobilă ChatGPT în browserele de pe desktop
  83. // @description:sq Aktivizo versionin mobile të ChatGPT në shfletuesit e desktopit
  84. // @description:sk Povoliť mobilnú verziu ChatGPT v desktopových prehliadačoch
  85. // @description:sl Omogočite mobilno različico ChatGPT v namiznih brskalnikih
  86. // @description:sr Активирајте мобилну верзију ChatGPT-а у десктоп прегледачима
  87. // @description:fi Ota käyttöön ChatGPT Mobile -versio työpöytäselaimissa
  88. // @description:sv Aktivera mobila versionen av ChatGPT i skrivbordswebbläsare
  89. // @description:vi Kích hoạt phiên bản di động của ChatGPT trên trình duyệt máy tính
  90. // @description:tr Masaüstü tarayıcılarda ChatGPT Mobile sürümünü etkinleştirin
  91. // @description:be Уключыць мабільную версію ChatGPT у настольных браўзерах
  92. // @description:bg Активиране на мобилната версия на ChatGPT в десктоп браузъри
  93. // @description:ky Стол таракчаларында ChatGPT Mobile версиясын иштетүү
  94. // @description:kk Столтік шолғыштарда ChatGPT Mobile нұсқасын қосу
  95. // @description:mk Овозможи мобилна верзија на ChatGPT во десктоп прелистувачи
  96. // @description:mn Дэскутоп браузерд ChatGPT Mobile ихэвчлэн ашиглах
  97. // @description:uk Увімкнути мобільну версію ChatGPT у браузерах для робочого столу
  98. // @description:el Ενεργοποίηση της κινητής έκδοσης του ChatGPT σε προγράμματα περιήγησης επιφάνειας εργασίας
  99. // @description:hy Միացնել ChatGPT բջջային տարբերակը աշխատանքային ժամանցման զննարկիչներում
  100. // @description:ur ڈیسک ٹاپ براؤزرز میں چیٹ جی پی ٹی موبائل کو فعال کریں
  101. // @description:ar تمكين نسخة ChatGPT المحمول في متصفحات سطح المكتب
  102. // @description:fa فعال کردن نسخه تلفن همراه ChatGPT در مرورگرهای دسکتاپ
  103. // @description:ne डेस्कटप ब्राउजरहरूमा ChatGPT मोबाइल सक्षम गर्नुहोस्
  104. // @description:mr डेस्कटॉप ब्राउझरमध्ये ChatGPT मोबाईल सक्षम करा
  105. // @description:hi डेस्कटॉप ब्राउज़रों में ChatGPT मोबाइल सक्षम करें
  106. // @description:as ডেক্সটপ ব্ৰাউজাৰত ChatGPT মোবাইল সক্ৰিয় কৰক
  107. // @description:bn ডেস্কটপ ব্রাউজারে ChatGPT মোবাইল সক্রিয় করুন
  108. // @description:pa ਡੈਸਕਟਾਪ ਬਰਾ browserਜ਼ਰ 'ਤੇ ਚੈਟਜੀਪੀਟੀ ਮੋਬਾਈਲ ਯੋਗ ਕਰੋ
  109. // @description:gu ડેસ્કટોપ બ્રાઉઝરમાં ChatGPT મોબાઇલ સક્રિય કરો
  110. // @description:or ଡେସ୍କଟପ ବ୍ରାଉଜରରେ ChatGPT ମୋବାଇଲ ସକ୍ରିୟ କରନ୍ତୁ
  111. // @description:ta மேல இணைய உலாவிகளில் ChatGPT மொபைல் பதிப்பை இயக்க
  112. // @description:te డెస్క్‌టాప్ బ్రౌజర్‌లో ChatGPT మొబైల్ వెర్షన్‌ను ప్రారంభించండి
  113. // @description:kn ಡೆಸ್ಕ್‌ಟಾಪ್ ಬ್ರೌಸರ್‌ಗಳಲ್ಲಿ ChatGPT ಮೊಬೈಲ್ ಆವೃತ್ತಿಯನ್ನು ಸಕ್ರಿಯಗೊಳಿಸಿ
  114. // @description:ml ഡെസ്ക്ടോപ് ബ്രൌസറുകളിൽ ChatGPT മൊബൈൽ പതിപ്പ് പ്രവർത്തനമാക്കുക
  115. // @description:si ඩෙස්ක්ටොප් බ්‍රවුසර් වල ChatGPT ජංගම අනුවාදය සක්‍රීය කරන්න
  116. // @description:th เปิดใช้งาน ChatGPT บนมือถือในเบราว์เซอร์เดสก์ท็อป
  117. // @description:lo ເປີດໃຊ້ ChatGPT ສະບັບມືຖືໃນໂປຣແກຣມທ່ອງເວັບໃນຄອມພິວເຕີ
  118. // @description:my ဒက်စ်တော့ဘရောင်ဇာများတွင် ChatGPT မိုဘိုင်းဗားရှင်းကို ဖွင့်ရန်
  119. // @description:ka ჩართეთ ChatGPT Mobile სამუშაო ბრაუზერებში
  120. // @description:am በዴስክቶፕ ብራውዘሮች ውስጥ ChatGPT ተቀናቃኝ ስሪትን አብረውው
  121. // @description:km បើក ChatGPT កំណែទូរស័ព្ទលើកម្មវិធីរុករកលើផ្ទៃតុ
  122.  
  123.  
  124. // ==/UserScript==
  125.  
  126. (() => {
  127. "use strict";
  128.  
  129. const REPLACE_DESKTOP_MODELS = false;
  130.  
  131. const mzs = [{
  132. // category: "other",
  133. desktop: "text-davinci-002-render-sha",
  134. mobile: "text-davinci-002-render-sha-mobile",
  135. human_category_name_mobile: "GPT-3.5-M"
  136. }, {
  137. // category: "other",
  138. desktop: "gpt-4",
  139. mobile: "gpt-4-mobile",
  140. human_category_name_mobile: "GPT-4-M"
  141. }];
  142.  
  143. const gptModels = {}
  144. for (const mz of mzs) {
  145. gptModels[mz.mobile] = {
  146. human_category_name: mz.human_category_name_mobile,
  147. default_model: mz.mobile
  148. };
  149. }
  150.  
  151. /** @type {globalThis.Window} */
  152. const win = typeof unsafeWindow === 'object' ? unsafeWindow : typeof window === 'object' ? window : this;
  153.  
  154.  
  155. /**
  156. * @typedef Category
  157. * @type {object}
  158. * @property {string} category
  159. * @property {string} human_category_name
  160. * @property {string} subscription_level
  161. * @property {string} default_model
  162. * @property {string} browsing_model
  163. * @property {string} code_interpreter_model
  164. * @property {string} plugins_model
  165. */
  166.  
  167. /**
  168. * @typedef Model
  169. * @type {object}
  170. * @property {string} slug
  171. * @property {number} max_tokens
  172. * @property {string} title
  173. * @property {string} description
  174. * @property {string[]} tags
  175. * @property {object} capabilities
  176. */
  177.  
  178. /**
  179. * @typedef JsonRes
  180. * @type {object}
  181. * @property {Category[]} categories
  182. * @property {Model[]} models
  183. */
  184.  
  185.  
  186. /**
  187. * @param {Model} model
  188. */
  189. function fixTitle(model) {
  190.  
  191. if (model.slug === "text-davinci-002-render-sha") {
  192. model.title = /\bdefault\b/i.test(model.title) ? "Default (GPT-3.5)" : "GPT-3.5";
  193. } else if (model.slug === "text-davinci-002-render-sha-mobile") {
  194. model.title = /\bdefault\b/i.test(model.title) ? "Default (GPT-3.5) (Mobile)" : "GPT-3.5 (Mobile)";
  195. } else if (model.slug === "gpt-4") {
  196. model.title = /\bdefault\b/i.test(model.title) ? "Default (GPT-4)" : "GPT-4";
  197. } else if (model.slug === "gpt-4-mobile") {
  198. model.title = /\bdefault\b/i.test(model.title) ? "Default (GPT-4) (Mobile)" : "GPT-4 (Mobile)";
  199. }
  200.  
  201. let suffix = `[${model.tags.join(', ')}]`;
  202. if (model.description.indexOf(suffix) < 0) model.description = `${model.description} ${suffix}`;
  203.  
  204. }
  205.  
  206. ((Response) => {
  207.  
  208. Response.prototype.__json7942__ = Response.prototype.json;
  209. Response.prototype.json = function () {
  210.  
  211. /** @type {globalThis.Response} */
  212. const __this__ = this;
  213. /** @type {Promise<any>} */
  214. let jsonPromise = __this__.__json7942__.apply(__this__, arguments);
  215.  
  216. jsonPromise = jsonPromise.then(__jsonRes__ => {
  217.  
  218. if (typeof (__jsonRes__ || 0).browsing === 'boolean' && typeof (__jsonRes__ || 0).code_interpreter === 'boolean' && typeof (__jsonRes__ || 0).plugins === 'boolean') {
  219. __jsonRes__.browsing = true;
  220. __jsonRes__.code_interpreter = true;
  221. __jsonRes__.plugins = true;
  222. }
  223.  
  224.  
  225. if (typeof (__jsonRes__ || 0).message_cap === 'number') {
  226.  
  227. if (__jsonRes__.message_cap < 9999) {
  228. __jsonRes__.message_cap = 9999;
  229. }
  230. }
  231.  
  232. if (typeof ((((__jsonRes__ || 0).accounts || 0).default || 0).features || 0) == 'object') {
  233.  
  234. let features = __jsonRes__.accounts.default.features;
  235.  
  236. let extraFeatures = [
  237. "model_preview",
  238. "browsing_available",
  239. "model_switcher",
  240. "plugins_available",
  241. "beta_features"
  242. ];
  243.  
  244. for (const s of extraFeatures) {
  245. if (features.indexOf(s) < 0) features.push(s);
  246. }
  247.  
  248. }
  249.  
  250. if (((__jsonRes__ || 0).categories || 0).length >= 1 && ((__jsonRes__ || 0).models || 0).length >= 1) {
  251.  
  252.  
  253. try {
  254. /** @type {JsonRes} */
  255. const jsonRes = __jsonRes__;
  256.  
  257. const categories = [...jsonRes.categories];
  258. let add_gpt_4_mobile = false;
  259. let add_gpt_3_mobile = false;
  260.  
  261. /** @type {Map<string, Category>} */
  262. const default_models = new Map();
  263. for (const cat of categories) {
  264. default_models.set(`${cat.default_model}`, cat);
  265. }
  266.  
  267. /** @type {Map<string, Model>} */
  268. const availableModels = new Map();
  269. for (const model of jsonRes.models) {
  270. availableModels.set(`${model.slug}`, model);
  271. fixTitle(model);
  272. }
  273.  
  274. const b = (d, m) => (default_models.has(d) && !default_models.has(m) && availableModels.has(d) && availableModels.has(m));
  275.  
  276. let gpt3 = mzs[0];
  277. let gpt4 = mzs[1];
  278. if (b(gpt3.desktop, gpt3.mobile)) add_gpt_3_mobile = true;
  279. if (b(gpt4.desktop, gpt4.mobile)) add_gpt_4_mobile = true;
  280.  
  281. if (add_gpt_3_mobile) {
  282. REPLACE_DESKTOP_MODELS
  283. ? Object.assign(default_models.get(gpt3.desktop), gptModels[gpt3.mobile])
  284. : categories.push(Object.assign({}, default_models.get(gpt3.desktop), gptModels[gpt3.mobile]));
  285. }
  286. if (add_gpt_4_mobile) {
  287. REPLACE_DESKTOP_MODELS
  288. ? Object.assign(default_models.get(gpt4.desktop), gptModels[gpt4.mobile])
  289. : categories.push(Object.assign({}, default_models.get(gpt4.desktop), gptModels[gpt4.mobile]));
  290. }
  291.  
  292. jsonRes.categories = categories;
  293.  
  294. } catch (e) {
  295. console.warn(e);
  296. }
  297.  
  298. }
  299.  
  300. return __jsonRes__;
  301.  
  302. });
  303. return jsonPromise;
  304.  
  305. };
  306. })(win.Response)
  307.  
  308. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址