-
-
Save Juice10/7c979306285b7b8a4588261663ce5a8b to your computer and use it in GitHub Desktop.
Repro Bug 28407
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script type="module"> | |
| </script> | |
| </head> | |
| <body> | |
| <simple-report-viewer></simple-report-viewer> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Behalten Sie eine globale Referenz auf das Fensterobjekt. | |
| // Wenn Sie dies nicht tun, wird das Fenster automatisch geschlossen, | |
| // sobald das Objekt dem JavaScript-Garbagekollektor übergeben wird. | |
| let win | |
| let { app, BrowserWindow } = require("electron"); | |
| async function createWindow() { | |
| // Erstellen des Browser-Fensters. | |
| win = new BrowserWindow({ | |
| width: 1400, height: 1024, frame: false, webPreferences: { | |
| nodeIntegration: true, | |
| enableRemoteModule: true, | |
| devTools: true | |
| } | |
| }) | |
| // Öffnen der DevTools. | |
| win.webContents.openDevTools() | |
| console.log('loading data url with baseURLForDataURL...') | |
| await win.loadURL('data:text/html,<html><body>hello world</body></html>', { | |
| baseURLForDataURL: 'https://example.com' | |
| }) | |
| console.log('loaded data url with baseURLForDataURL') | |
| // Ausgegeben, wenn das Fenster geschlossen wird. | |
| win.on('closed', () => { | |
| // Dereferenzieren des Fensterobjekts, normalerweise würden Sie Fenster | |
| // in einem Array speichern, falls Ihre App mehrere Fenster unterstützt. | |
| // Das ist der Zeitpunkt, an dem Sie das zugehörige Element löschen sollten. | |
| win = null | |
| }) | |
| } | |
| //https://gist.github.com/smotaal/f1e6dbb5c0420bfd585874bd29f11c43 -- look and use | |
| //https://stackoverflow.com/questions/51113097/electron-es6-module-import/51126482 | |
| // Diese Methode wird aufgerufen, wenn Electron mit der | |
| // Initialisierung fertig ist und Browserfenster erschaffen kann. | |
| // Einige APIs können nur nach dem Auftreten dieses Events genutzt werden. | |
| app.on('ready', | |
| async () => { | |
| await createWindow(); | |
| } | |
| ); | |
| // Verlassen, wenn alle Fenster geschlossen sind. | |
| app.on('window-all-closed', () => { | |
| // Unter macOS ist es üblich, für Apps und ihre Menu Bar | |
| // aktiv zu bleiben, bis der Nutzer explizit mit Cmd + Q die App beendet. | |
| //if (process.platform !== 'darwin') { | |
| app.quit() | |
| //} | |
| }) | |
| app.on('activate', async () => { | |
| // Unter macOS ist es üblich ein neues Fenster der App zu erstellen, wenn | |
| // das Dock Icon angeklickt wird und keine anderen Fenster offen sind. | |
| if (win === null) { | |
| await createWindow() | |
| } | |
| }) | |
| // In dieser Datei können Sie den Rest des App-spezifischen | |
| // Hauptprozess-Codes einbinden. Sie können den Code auch | |
| // auf mehrere Dateien aufteilen und diese hier einbinden. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Empty |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This file is required by the index.html file and will | |
| // be executed in the renderer process for that window. | |
| // All of the Node.js APIs are available in this process. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Empty */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment