123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- <!-- Copyright (C) Microsoft Corporation. All rights reserved. -->
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <meta name="mobile-web-app-capable" content="yes" />
- <meta name="apple-mobile-web-app-capable" content="yes" />
- <meta name="apple-mobile-web-app-title" content="Code">
- <link rel="apple-touch-icon" href="https://app.itk.academy/favicon.svg" />
- <meta name="viewport"
- content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
- <meta id="vscode-workbench-web-configuration" data-settings="{{WORKBENCH_WEB_CONFIGURATION}}">
- <meta id="vscode-workbench-auth-session" data-settings="{{WORKBENCH_AUTH_SESSION}}">
- <link rel="icon" href="https://app.itk.academy/favicon.svg">
- <link rel="manifest" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/manifest.json"
- crossorigin="use-credentials" />
- </head>
- <body>
- <div>
- <div>ИТК. Академия Хэде 0ldр! {{WORKBENCH_WEB_BASE_URL}}</div>
- <div aria-label=""></div>
- </div>
- </body>
- <script>
- function logs() {
- }
- (function () {
- // Save the original fetch function
- const originalFetch = window.fetch;
- // Override the fetch function
- window.fetch = function (resource, config) {
- // Check if the request URL matches the one you want to suppress
- if (typeof resource === 'string' && resource.includes('vsda.js')) {
- alert('ok')
- // Return a resolved promise with a mock response
- return Promise.resolve({
- ok: false,
- status: 404,
- statusText: 'Not Found',
- url: resource,
- json: () => Promise.resolve({}),
- text: () => Promise.resolve(''),
- });
- }
- // For all other requests, proceed with the original fetch
- return originalFetch(resource, config)
- .then(response => {
- // Handle responses for other requests if needed
- return response;
- })
- .catch(error => {
- // Handle errors for other requests if needed
- throw error;
- });
- };
- })();
- (function () {
- // Save original console methods
- const originalConsole = {
- log: console.log,
- error: console.error,
- warn: console.warn,
- info: console.info,
- debug: console.debug,
- };
- // Function to check if the log is from an iframe
- function isLogFromIframe() {
- const errorStack = new Error().stack; // Get the stack trace
- return errorStack.includes("HTMLIFrameElement"); // Check if the stack includes iframe
- }
- // Override console methods
- console.log = function (...args) {
- if (isLogFromIframe()) {
- originalConsole.log.apply(console, args); // Allow logs from iframe
- }
- };
- console.error = function (...args) {
- if (isLogFromIframe()) {
- originalConsole.error.apply(console, args); // Allow errors from iframe
- }
- };
- console.warn = function (...args) {
- if (isLogFromIframe()) {
- originalConsole.warn.apply(console, args); // Allow warnings from iframe
- }
- };
- console.info = function (...args) {
- if (isLogFromIframe()) {
- originalConsole.info.apply(console, args); // Allow info logs from iframe
- }
- };
- console.debug = function (...args) {
- if (isLogFromIframe()) {
- originalConsole.debug.apply(console, args); // Allow debug logs from iframe
- }
- };
- })();
- const wbUrl = "{{WORKBENCH_WEB_BASE_URL}}"
- const baseUrl = new URL(wbUrl, window.location.origin).toString();
- globalThis._VSCODE_FILE_ROOT = baseUrl + '/out/';
- let isFast = window.location.href.indexOf('fast=1') > -1;
- let domain = isFast ? 'https://localhost:7000' : globalThis._VSCODE_FILE_ROOT;
- if (!isFast) {
- runCssDirect(` footer [aria-label=remote]:after{content:'ITK Academy CodeRun';font-weight:700}.actions-container[role=tablist]{display:flex!important;flex-direction:column!important}.actions-container[role=tablist] li{order:2!important}.actions-container[role=tablist] li:first-child{order:0!important}.actions-container[role=tablist] li:last-child:has([aria-label*="ITK Academy"]){order:1!important} `)
- insertCssLink(domain + "/vs/code/browser/workbench/workbench.css")
- runBlob(domain + "/vs/code/browser/workbench/workbench.js")
- runBlob(domain + "/nls.messages.js")
- } else {
- runCss(domain + "/vs/code/browser/workbench/workbench.css")
- runBlob(domain + "/vs/code/browser/workbench/workbench.js")
- runBlob(domain + "/nls.messages.js")
- }
- function insertCssLink(href) {
- var link = document.createElement('link');
- link.rel = 'stylesheet'; // Specify it's a stylesheet
- link.href = href; // Specify the CSS file path
- document.head.appendChild(link);
- }
- function runCssDirect(text) {
- let style = document.createElement("style");
- style.textContent = text;
- document.head.appendChild(style);
- }
- function runCss(url) {
- fetch(url)
- .then(response => response.text())
- .then(css => {
- runCssDirect(isFast ? css.replace(/\/media\//g, (v) => {
- // return domain + '/media/'
- return globalThis._VSCODE_FILE_ROOT + '/media/'
- }) : css)
- })
- .catch(error => {
- // console.error("Failed to load CSS:", error)
- });
- }
- function runBlob(src) {
- fetch(src)
- .then(response => {
- if (!response.ok) {
- // throw new Error(`HTTP error! Status: ${response.status}`);
- return;
- }
- return response.text();
- })
- .then(scriptText => {
- const code = scriptText//`export function test() { return 'Hello, Modules!'; }`;
- const blob = new Blob([code], { type: 'application/javascript' });
- const url = URL.createObjectURL(blob);
- import(url).then((module) => {
- // console.log(module.test()); // Output: Hello, Modules!
- });
- // eval(scriptText)
- })
- .catch(error => {
- // console.error("Failed to load script:", error)
- });
- }
- </script>
- </html>
|