WebMaster Pro

Ultimate web toolkit featuring multilingual captions, code fixing, Roblox server finder, YouTube song detection, and more

  1. // ==UserScript==
  2. // @name WebMaster Pro
  3. // @namespace https://sourcegraph.com/
  4. // @version 7.2
  5. // @description Ultimate web toolkit featuring multilingual captions, code fixing, Roblox server finder, YouTube song detection, and more
  6. // @author Cosmic Kitten with help from Cody A.I
  7. // @license MIT
  8. // @match *://*/*
  9. // @match https://www.roblox.com/games/*
  10. // @match https://web.roblox.com/games/*
  11. // @match https://www.youtube.com/*
  12. // @require https://code.jquery.com/jquery-3.6.0.min.js
  13. // @require https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/mark.min.js
  14. // @grant GM_xmlhttpRequest
  15. // @grant GM_setValue
  16. // @grant GM_getValue
  17. // @grant GM_addStyle
  18. // @grant GM_registerMenuCommand
  19. // @grant GM_notification
  20. // @connect bing.com
  21. // @connect roblox.com
  22. // @connect grammarly.com
  23. // @connect youtube.com
  24. // @supportURL https://github.com/yourusername/webmaster-pro/issues
  25. // @homepage https://github.com/yourusername/webmaster-pro
  26. // ==/UserScript==
  27.  
  28. /* Library Attribution */
  29. /*
  30. * jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license
  31. * mark.js v8.11.1 | (c) Julian Kühnel | github.com/julmot/mark.js
  32. */
  33.  
  34. // Global error handler
  35. const errorHandler = {
  36. catch: function(error, context) {
  37. console.error(`WebMaster Pro - ${context}:`, error);
  38. GM_notification({
  39. text: `Error in ${context}. Check console for details.`,
  40. title: 'WebMaster Pro',
  41. timeout: 3000
  42. });
  43. }
  44. };
  45.  
  46. // Safe initialization wrapper
  47. const initWithSafety = (fn, context) => {
  48. try {
  49. return fn();
  50. } catch (error) {
  51. errorHandler.catch(error, context);
  52. }
  53. };
  54.  
  55. /* Core Modules */
  56. const WebMasterCore = {
  57. settings: {
  58. lastUpdateCheck: 0,
  59. updateInterval: 86400000, // 24 hours
  60. },
  61.  
  62. init() {
  63. this.loadSettings();
  64. this.initModules();
  65. this.setupEventListeners();
  66. },
  67.  
  68. loadSettings() {
  69. const saved = GM_getValue('webmaster_settings');
  70. if (saved) {
  71. this.settings = {...this.settings, ...JSON.parse(saved)};
  72. }
  73. },
  74.  
  75. saveSettings() {
  76. GM_setValue('webmaster_settings', JSON.stringify(this.settings));
  77. },
  78.  
  79. initModules() {
  80. initWithSafety(() => {
  81. CodyGUI.init();
  82. YouTubeDetector.init();
  83. RobloxFinder.init();
  84. PageSearcher.init();
  85. TranslationEngine.init();
  86. }, 'Module Initialization');
  87. }
  88. };
  89.  
  90. /* Cody GUI Module - Enhanced */
  91. const CodyGUI = {
  92. init() {
  93. this.createInterface();
  94. this.setupEventListeners();
  95. },
  96.  
  97. createInterface() {
  98. const gui = document.createElement('div');
  99. gui.id = 'cody-assistant';
  100. gui.innerHTML = `
  101. <div class="cody-panel">
  102. <div class="cody-header">
  103. <span class="cody-title">WebMaster Pro</span>
  104. <div class="cody-controls">
  105. <button class="minimize">_</button>
  106. <button class="close">×</button>
  107. </div>
  108. </div>
  109. <div class="cody-content">
  110. <div class="feature-buttons">
  111. <button data-action="translate">Translate Page</button>
  112. <button data-action="findServer">Find Roblox Server</button>
  113. <button data-action="detectSong">Detect Song</button>
  114. <button data-action="searchPage">Search Page</button>
  115. </div>
  116. <div class="status-area"></div>
  117. </div>
  118. </div>
  119. `;
  120. document.body.appendChild(gui);
  121. }
  122. };
  123.  
  124. /* YouTube Detector - Enhanced */
  125. const YouTubeDetector = {
  126. init() {
  127. if (window.location.hostname.includes('youtube.com')) {
  128. this.setupDetector();
  129. }
  130. },
  131.  
  132. setupDetector() {
  133. const observer = new MutationObserver(() => {
  134. this.detectAndDisplay();
  135. });
  136. observer.observe(document.body, {
  137. childList: true,
  138. subtree: true
  139. });
  140. },
  141.  
  142. async detectAndDisplay() {
  143. const video = document.querySelector('video');
  144. if (!video) return;
  145.  
  146. const videoTitle = document.querySelector('h1.ytd-video-primary-info-renderer');
  147. if (videoTitle) {
  148. const songInfo = this.parseSongInfo(videoTitle.textContent);
  149. this.showSongInfo(songInfo);
  150. }
  151. }
  152. };
  153.  
  154. /* Roblox Server Finder - Enhanced */
  155. const RobloxFinder = {
  156. init() {
  157. if (window.location.href.includes('roblox.com/games/')) {
  158. this.setupFinder();
  159. }
  160. },
  161.  
  162. async findServer() {
  163. const servers = await this.fetchServers();
  164. if (servers?.length > 0) {
  165. const bestServer = this.findBestServer(servers);
  166. this.joinServer(bestServer);
  167. }
  168. }
  169. };
  170.  
  171. /* Styles - Enhanced and Optimized */
  172. GM_addStyle(`
  173. #cody-assistant {
  174. --primary-color: #2196F3;
  175. --secondary-color: #00b06f;
  176. --text-color: #ffffff;
  177. --shadow-color: rgba(0,0,0,0.3);
  178. font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  179. }
  180.  
  181. .cody-panel {
  182. position: fixed;
  183. bottom: 80px;
  184. right: 20px;
  185. background: linear-gradient(145deg, var(--primary-color), var(--secondary-color));
  186. border-radius: 12px;
  187. padding: 20px;
  188. color: var(--text-color);
  189. z-index: 999999;
  190. box-shadow: 0 4px 15px var(--shadow-color);
  191. transition: all 0.3s ease;
  192. width: 300px;
  193. max-height: 500px;
  194. overflow: hidden;
  195. }
  196.  
  197. .feature-buttons button {
  198. width: 100%;
  199. padding: 10px;
  200. margin: 5px 0;
  201. border: none;
  202. border-radius: 6px;
  203. background: rgba(255,255,255,0.2);
  204. color: var(--text-color);
  205. cursor: pointer;
  206. transition: all 0.2s ease;
  207. font-weight: 500;
  208. }
  209.  
  210. .feature-buttons button:hover {
  211. background: rgba(255,255,255,0.3);
  212. transform: translateY(-1px);
  213. }
  214. `);
  215.  
  216. // Initialize everything
  217. document.addEventListener('DOMContentLoaded', () => {
  218. initWithSafety(() => WebMasterCore.init(), 'Main Initialization');
  219. });