|
|
@@ -33,7 +33,6 @@ function decryptDirectory(directoryPath) {
|
|
|
}
|
|
|
|
|
|
function createWindow() {
|
|
|
- console.log('2')
|
|
|
const directoryToDecrypt = path.join(process.resourcesPath, 'app.asar', 'static');
|
|
|
decryptDirectory(directoryToDecrypt);
|
|
|
|
|
|
@@ -51,7 +50,7 @@ function createWindow() {
|
|
|
win.loadFile('index.html');
|
|
|
|
|
|
// 打开调试工具
|
|
|
- win.webContents.openDevTools();
|
|
|
+ // win.webContents.openDevTools();
|
|
|
|
|
|
// 创建菜单模板,只包含一个刷新按钮
|
|
|
const menuTemplate = [
|
|
|
@@ -78,7 +77,6 @@ function createWindow() {
|
|
|
}
|
|
|
|
|
|
app.on('ready', () => {
|
|
|
- console.log('1')
|
|
|
// Intercept file requests and serve from memory
|
|
|
session.defaultSession.webRequest.onBeforeRequest((details, callback) => {
|
|
|
const url = new URL(details.url);
|
|
|
@@ -90,7 +88,7 @@ app.on('ready', () => {
|
|
|
fs.mkdirSync(path.dirname(tempFilePath), { recursive: true });
|
|
|
fs.writeFileSync(tempFilePath, memoryCache[relativePath]);
|
|
|
|
|
|
- console.log(`Intercepting request for: ${relativePath}, redirectURL: ${tempFilePath}`);
|
|
|
+ // console.log(`Intercepting request for: ${relativePath}, redirectURL: ${tempFilePath}`);
|
|
|
|
|
|
let mimeType = 'text/plain';
|
|
|
if (relativePath.endsWith('.js')) {
|
|
|
@@ -100,7 +98,7 @@ app.on('ready', () => {
|
|
|
} else if (relativePath.endsWith('.html')) {
|
|
|
mimeType = 'text/html';
|
|
|
}
|
|
|
- console.log(`Serving from memory: ${relativePath} as ${mimeType}`);
|
|
|
+ // console.log(`Serving from memory: ${relativePath} as ${mimeType}`);
|
|
|
callback({ cancel: false, redirectURL: tempFilePath });
|
|
|
} else {
|
|
|
callback({ cancel: false });
|