Greasy Fork 支持简体中文。

Inject HTML into PenguinMod Editor

Inject custom HTML into the PenguinMod editor page

  1. // ==UserScript==
  2. // @name Inject HTML into PenguinMod Editor
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Inject custom HTML into the PenguinMod editor page
  6. // @author You
  7. // @match https://studio.penguinmod.com/editor.html
  8. // @grant none
  9. // @run-at document-end
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // Create a new div element
  16. const newDiv = document.createElement('div');
  17. newDiv.id = 'custom-html-container';
  18. newDiv.style.position = 'fixed';
  19. newDiv.style.top = '0';
  20. newDiv.style.left = '0';
  21. newDiv.style.width = '100%';
  22. newDiv.style.height = '100%';
  23. newDiv.style.backgroundColor = '#fff'; // Set a background color if needed
  24. newDiv.style.zIndex = '9999'; // Make sure it's on top of other elements
  25.  
  26. // HTML content to be injected
  27. const htmlContent = `
  28. <!DOCTYPE html>
  29. <html lang="en">
  30. <head>
  31. <meta charSet="utf-8"/>
  32. <meta name="viewport" content="width=device-width"/>
  33. <meta name="next-head-count" content="2"/>
  34. <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/>
  35. <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/>
  36. <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/>
  37. <link rel="manifest" href="/site.webmanifest"/>
  38. <title>Gandi - The collaborative in-browser IDE for game creation</title>
  39. <meta name="keywords" content="Scratch, turbowarp, gandi, Minecraft, online game, among us, itch.io, roblox"/>
  40. <meta name="description" content="Gandi IDE is a Scratch mod, it's a simple but powerful online game engine. An editor, interpreter, compiler, assets market, and MMO server are built inside. Realtime code, create and learn together right in your browser. "/>
  41. <meta name="twitter:title" content="Gandi - The collaborative in-browser IDE for game creation"/>
  42. <meta name="twitter:description" content="Gandi IDE is a Scratch mod, it's a simple but powerful online game engine. An editor, interpreter, compiler, assets market, and MMO server are built inside. Realtime code, create and learn together right in your browser. "/>
  43. <meta name="twitter:site" content="@cocrea"/>
  44. <meta name="twitter:card" content="summary_large_image"/>
  45. <meta name="twitter:image"/>
  46. <meta name="twitter:image:src"/>
  47. <meta name="theme-color" content="#62B5DE"/>
  48. <meta property="og:url" content="https://cocrea.world//gandi"/>
  49. <meta property="og:type" content="website"/>
  50. <meta property="og:site_name" content="Gandi IDE"/>
  51. <meta property="og:title" content="Gandi - The collaborative in-browser IDE for game creation"/>
  52. <meta property="og:description" content="Gandi IDE is a Scratch mod, it's a simple but powerful online game engine. An editor, interpreter, compiler, assets market, and MMO server are built inside. Realtime code, create and learn together right in your browser. "/>
  53. <meta property="og:image"/>
  54. <link rel="preload" href="/_next/static/css/47b7a0011e26ad62.css" as="style"/>
  55. <link rel="stylesheet" href="/_next/static/css/47b7a0011e26ad62.css" data-n-g=""/>
  56. <link rel="preload" href="/_next/static/css/edd0ee245ac8806d.css" as="style"/>
  57. <link rel="stylesheet" href="/_next/static/css/edd0ee245ac8806d.css" data-n-p=""/>
  58. <noscript data-n-css=""></noscript>
  59. <script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script>
  60. <script src="/_next/static/chunks/webpack-72b99510082e1411.js" defer=""></script>
  61. <script src="/_next/static/chunks/framework-9cf46cf0fe8d1146.js" defer=""></script>
  62. <script src="/_next/static/chunks/main-421e2a345d25ad70.js" defer=""></script>
  63. <script src="/_next/static/chunks/pages/_app-258bb0eb1c3dd98f.js" defer=""></script>
  64. <script src="/_next/static/chunks/pages/gandi-a3301fbc07fd27d7.js" defer=""></script>
  65. <script src="/_next/static/cocrea/_buildManifest.js" defer=""></script>
  66. <script src="/_next/static/cocrea/_ssgManifest.js" defer=""></script>
  67. </head>
  68. <body>
  69. <div id="__next"></div>
  70. <script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"locale":"en","_sentryTraceData":"cb9830b54c64475890a96a9e18a74218-be6b52ca21e83390-1","_sentryBaggage":"sentry-environment=production,sentry-release=cocrea,sentry-transaction=%2Fgandi,sentry-public_key=87063421a33d4b3dba8c5956d38c3642,sentry-trace_id=cb9830b54c64475890a96a9e18a74218,sentry-sample_rate=1","hideNav":true,"shouldIndentWhenShowNav":false,"noNavAnimation":true,"seoConfig":{"title":"Gandi - The collaborative in-browser IDE for game creation","description":"Gandi IDE is a Scratch mod, it's a simple but powerful online game engine. An editor, interpreter, compiler, assets market, and MMO server are built inside. Realtime code, create and learn together right in your browser. ","keywords":"Scratch, turbowarp, gandi, Minecraft, online game, among us, itch.io, roblox","path":"/gandi"},"_nextI18Next":{"initialI18nStore":{"en":{"nav":{"about":"About Us","classroom":"Classroom","createButton":"Create","discord":"Join the Discord","docs":"Learn \u0026 Docs","educators":"For Educators","explore":"Explore","facebook":"Join Facebook Group","home":"Dashboard","homepage":"Homepage","menu":{"account":"Account Settings","signout":"Sign out"},"projects":"Projects","refer":"Naquagems","search":{"placeholder":"Search for projects or creators","resultTitle":"Search Results","popularSearches":"Popular Searches","seeMore":"See more","tab":{"all":"All","creators":"Creators","projects":"Projects"}},"notification":{"comment":"commented on","creationCreated":"has released a new project","creationUpdated":"has updated the project","follow":"subscribed to you","joinClass":"joined the class","like":"liked your project","likeButtonText":"Like","loadMore":"Load More","publishAssignment":"New assignment!","reply":"replied to your comment on","submitWork":"submitted the classwork","subscribedUserLike":"liked the project","title":"Messages","remix_creation":"remixed your project"}},"common":{"comment":{"add":"Leave a comment","commentButton":"Post","delete":{"label":"Delete"},"hide":"Hide {{count}} replies","pin":{"content":"pinned comment","title":"Pin"},"reply":"Reply","report":{"desc":"Reports will be reviewed by the Mod team. If approved, reported comments will be deleted.","label":"Report","reason":{"label":"Reason","optional1":"Advertising or Spam","optional2":"Offensive","optional3":"Harassment or Threats","optional4":"Privacy Violation","optional5":"Other","title":"Reason"},"title":"Report comment"},"seeMore":"View {{count}} replies","totalNum":"{{count}} Comments","unpin":{"title":"unpin"}},"common":{"back":"Back","bio":"Bio","cancel":"Cancel","change":"Change","charactersLimit":"characters","commingSoon":"Coming soon","confirm":"Confirm","copied":"COPIED!","copy":"COPY","days":"days ago","delete":"Delete","description":"Description","done":"Done","edit":"Edit","email":"Email","GotIt":"Got it","hours":"hours ago","Import":"Import","Imported":"Imported","learnMore":"Learn more","Likes":"Likes","loginTitle":"Welcome to Cocrea! ","minutes":"minutes ago","months":"months ago","next":"Next","nickname":"Nickname","ok":"OK","password":"Password","preview":"Preview","previous":"Previous","projectsNum":"Projects","publish":"Publish","reset":"Reset","save":"Save","send":"SEND","sent":"SENT!","seconds":"seconds ago","submit":"Submit","title":"Title","update":"Update","upload":"Upload","weeks":"weeks ago","years":"years ago"}},"_nextI18Next":{"initialI18nStore":{"en":{"common":{"comment":{"add":"Leave a comment","commentButton":"Post","delete":{"label":"Delete"},"hide":"Hide {{count}} replies","pin":{"content":"pinned comment","title":"Pin"},"reply":"Reply","report":{"desc":"Reports will be reviewed by the Mod team. If approved, reported comments will be deleted.","label":"Report","reason":{"label":"Reason","optional1":"Advertising or Spam","optional2":"Offensive","optional3":"Harassment or Threats","optional4":"Privacy Violation","optional5":"Other","title":"Reason"},"title":"Report comment"},"seeMore":"View {{count}} replies","totalNum":"{{count}} Comments","unpin":{"title":"unpin"}},"common":{"back":"Back","bio":"Bio","cancel":"Cancel","change":"Change","charactersLimit":"characters","commingSoon":"Coming soon","confirm":"Confirm","copied":"COPIED!","copy":"COPY","days":"days ago","delete":"Delete","description":"Description","done":"Done","edit":"Edit","email":"Email","GotIt":"Got it","hours":"hours ago","Import":"Import","Imported":"Imported","learnMore":"Learn more","Likes":"Likes","loginTitle":"Welcome to Cocrea! ","minutes":"minutes ago","months":"months ago","next":"Next","nickname":"Nickname","ok":"OK","password":"Password","preview":"Preview","previous":"Previous","projectsNum":"Projects","publish":"Publish","reset":"Reset","save":"Save","send":"SEND","sent":"SENT!","seconds":"seconds ago","submit":"Submit","title":"Title","update":"Update","upload":"Upload","weeks":"weeks ago","years":"years ago"}},"page":"/gandi"},"serverRendered":true,"hydratable":true}}</script>
  71. <script src="/_next/static/chunks/837-8324894a27223979.js" defer=""></script>
  72. </body>
  73. </html>`;
  74.  
  75. // Insert the HTML content into the new div
  76. newDiv.innerHTML = htmlContent;
  77.  
  78. // Append the new div to the body
  79. document.body.appendChild(newDiv);
  80. })();