wb.html 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <!-- Copyright (C) Microsoft Corporation. All rights reserved. -->
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <meta charset="utf-8" />
  6. <meta name="mobile-web-app-capable" content="yes" />
  7. <meta name="apple-mobile-web-app-capable" content="yes" />
  8. <meta name="apple-mobile-web-app-title" content="Code">
  9. <link rel="apple-touch-icon" href="https://app.itk.academy/favicon.svg" />
  10. <meta name="viewport"
  11. content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
  12. <meta id="vscode-workbench-web-configuration" data-settings="{&quot;remoteAuthority&quot;:&quot;localhost:3000&quot;,&quot;serverBasePath&quot;:&quot;/&quot;,&quot;developmentOptions&quot;:{&quot;logLevel&quot;:3},&quot;enableWorkspaceTrust&quot;:true,&quot;productConfiguration&quot;:{},&quot;callbackRoute&quot;:&quot;/stable-56bdd153e7c7f853189fd6965f73b2049f6d06c9/callback&quot;}">
  13. <meta id="vscode-workbench-auth-session" data-settings="">
  14. <link rel="icon" href="https://app.itk.academy/favicon.svg">
  15. <link rel="manifest" href="/stable-56bdd153e7c7f853189fd6965f73b2049f6d06c9/static/resources/server/manifest.json" crossorigin="use-credentials" />
  16. </head>
  17. <body>
  18. <div>asdfasdf /stable-56bdd153e7c7f853189fd6965f73b2049f6d06c9/static/out/nls.messages.js
  19. <div>чччфывафыважфыл ва</div>
  20. <div aria-label=""></div>
  21. </div>
  22. </body>
  23. <script>
  24. let orig = 'http://localhost:3000'// window.location.origin;
  25. const baseUrl = new URL('/stable-56bdd153e7c7f853189fd6965f73b2049f6d06c9/static', orig).toString();
  26. globalThis._VSCODE_FILE_ROOT = baseUrl + '/out/';
  27. let domain = window.location.href.indexOf('original=1') > -1 ? globalThis._VSCODE_FILE_ROOT : 'https://localhost:7000'
  28. runCss(domain + "/vs/code/browser/workbench/workbench.css", true)
  29. runBlob(domain + "/vs/code/browser/workbench/workbench.js")
  30. runBlob(domain + "/nls.messages.js")
  31. function runCss(url) {
  32. fetch(url)
  33. .then(response => response.text())
  34. .then(css => {
  35. let style = document.createElement("style");
  36. style.textContent = css.replace(/\/media\//g, (v) => {
  37. // return domain + '/media/'
  38. return globalThis._VSCODE_FILE_ROOT + '/media/'
  39. });
  40. document.head.appendChild(style);
  41. })
  42. .catch(error => console.error("Failed to load CSS:", error));
  43. }
  44. function runBlob(src) {
  45. fetch(src)
  46. .then(response => {
  47. if (!response.ok) {
  48. throw new Error(`HTTP error! Status: ${response.status}`);
  49. }
  50. return response.text();
  51. })
  52. .then(scriptText => {
  53. const code = scriptText//`export function test() { return 'Hello, Modules!'; }`;
  54. const blob = new Blob([code], { type: 'application/javascript' });
  55. const url = URL.createObjectURL(blob);
  56. import(url).then((module) => {
  57. console.log(module.test()); // Output: Hello, Modules!
  58. });
  59. eval(scriptText)
  60. })
  61. .catch(error => console.error("Failed to load script:", error));
  62. }
  63. </script>
  64. </html>