electron

牛逼!迅雷的代码结构竟然被扒了个精光!

做~自己de王妃 提交于 2021-01-07 11:51:29
点击上方“ Github喵 ”,选择“星标”公众号 重磅干货,第一时间送达 作者:jiawen 链接:juejin.im/post/6890344584078721031 # 背景 大家好,我是你们可爱的喵哥! 之前扒过飞书的源码,从代码设计架构层面里里外外学习一把,飞书还是挺 “大方” 的,源码在客户端和网页端都一览无余,不过好像新版本已经看不到了。相关的文章由于在内网技术论坛发过了不便于再发出来(泄露内部资料会被查水表的),因此这次周末抽时间换一个鸟窝来掏一掏。 一不小心发现迅雷的客户端竟然也是基于 Electron 开发的,那代码就好扒拉了。(先吐槽一下这新版本的某 lei 为什么要抄钉钉的界面,这些年某 lei 都不知道自己要干什么了,每个版本都招人嫌)。 # 拆解篇 一点背景知识说明 基于前端技术栈 Electron 构建的桌面应用,本质上都是加载本地前端资源文件,而这些文件通常是用 asar 格式(类似 windows iso 镜像)的方式进行打包,然后运行时再通过挂在到内存实现前端资源文件 js/css/html/img 等文件的读取。 这么说 asar 想办法挂载就可以随意阅读源码了吗?不是的。同时 asar 会提供一套通过加密方式防止任意解压,飞书就是这么做的,直接通过 asar extract 的方式无法解包出来。但是由于 node 端和 rust

Can't import css houdini paint js file

生来就可爱ヽ(ⅴ<●) 提交于 2021-01-07 07:01:09
问题 I have a React/Electron app, where I'm trying to use the new CSS Houdini paint() function (as demonstrated in this page). In my project's index.html file I have added a script tag with the paintWorklet addModule() function as shown: <script> CSS.paintWorklet.addModule('../src/ResultDisplay/DefaultResultDisplay/testPaint.js'); </script> Then in that testPaint.js file I have essentially a copy of what's shown in that blog post: registerPaint( "testPaint", class { paint(ctx, geom) { console.log(

Can't import css houdini paint js file

不羁的心 提交于 2021-01-07 06:59:19
问题 I have a React/Electron app, where I'm trying to use the new CSS Houdini paint() function (as demonstrated in this page). In my project's index.html file I have added a script tag with the paintWorklet addModule() function as shown: <script> CSS.paintWorklet.addModule('../src/ResultDisplay/DefaultResultDisplay/testPaint.js'); </script> Then in that testPaint.js file I have essentially a copy of what's shown in that blog post: registerPaint( "testPaint", class { paint(ctx, geom) { console.log(

How to customize scrollbar for atom electron iframe or webview?

主宰稳场 提交于 2021-01-07 03:39:54
问题 How to customize scrollbar for atom electron iframe or webview ? My example: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <titleScrollbar Demo</title> </head> <body style="margin: 0px;overflow:hidden;"> <iframe src="http://bbc.com" height="500" width="500"></iframe> <webview src="http://bbc.com" height="500" width="500"></webview> </body> </html> 回答1: Electron 11: this.webview.addEventListener("dom-ready", (e: Electron.IpcMessageEvent) => { this.webview.insertCSS(` ::-webkit-scrollbar

sandboxed electron app cant use ffmpeg (mac apple store)

喜夏-厌秋 提交于 2021-01-07 02:37:31
问题 The bounty expires in 4 days . Answers to this question are eligible for a +50 reputation bounty. Martin wants to draw more attention to this question. I am trying to build an electron application for the mac apple store that uses ffmpeg. I can use fluent-ffmpeg locally fine and It continues to work when I build my app for windows/mac/linux, but when I build a sandoxed Mac Apple Store (MAS) .app file and sign the .app file, fluent-ffmpeg does not work anymore, and throws an ffmpeg was killed

Electron installing abort - ECONNRESET

∥☆過路亽.° 提交于 2021-01-07 01:39:31
问题 I'm trying to install electron via npm and I get this error : How can I solve it? 回答1: You can set custom mirrors to download electron from a seperate mirror. Just add this before npm install , or inside the hooks somewhere. ELECTRON_MIRROR="https://npm.taobao.org/mirrors/electron/" I've always used this because github were extremely slow for electron release downloads even on the servers. 回答2: Might be a bad internet connection or a proxy issue. You may want to try to remove your proxy: npm

Electron installing abort - ECONNRESET

一曲冷凌霜 提交于 2021-01-07 01:37:50
问题 I'm trying to install electron via npm and I get this error : How can I solve it? 回答1: You can set custom mirrors to download electron from a seperate mirror. Just add this before npm install , or inside the hooks somewhere. ELECTRON_MIRROR="https://npm.taobao.org/mirrors/electron/" I've always used this because github were extremely slow for electron release downloads even on the servers. 回答2: Might be a bad internet connection or a proxy issue. You may want to try to remove your proxy: npm

electron-forge with two windows : how to render the second window? electron-react app

亡梦爱人 提交于 2021-01-07 01:34:38
问题 I realized that the second electron browser window, does actually opens, but it doesn't render correctly. In /tools/forge/forge.config.js I have two entryPoints for the two windows: entryPoints: [ { // React Hot Module Replacement (HMR) rhmr: 'react-hot-loader/patch', // HTML index file template html: path.join(rootDir, 'src/index.html'), // Renderer js: path.join(rootDir, 'src/renderer.ts'), // Main Window name: 'main_window', // Preload preload: { js: path.join(rootDir, 'src/preload.ts'), }

electron-forge with two windows : how to render the second window? electron-react app

陌路散爱 提交于 2021-01-07 01:33:45
问题 I realized that the second electron browser window, does actually opens, but it doesn't render correctly. In /tools/forge/forge.config.js I have two entryPoints for the two windows: entryPoints: [ { // React Hot Module Replacement (HMR) rhmr: 'react-hot-loader/patch', // HTML index file template html: path.join(rootDir, 'src/index.html'), // Renderer js: path.join(rootDir, 'src/renderer.ts'), // Main Window name: 'main_window', // Preload preload: { js: path.join(rootDir, 'src/preload.ts'), }

electron-forge with two windows : how to render the second window? electron-react app

只愿长相守 提交于 2021-01-07 01:33:15
问题 I realized that the second electron browser window, does actually opens, but it doesn't render correctly. In /tools/forge/forge.config.js I have two entryPoints for the two windows: entryPoints: [ { // React Hot Module Replacement (HMR) rhmr: 'react-hot-loader/patch', // HTML index file template html: path.join(rootDir, 'src/index.html'), // Renderer js: path.join(rootDir, 'src/renderer.ts'), // Main Window name: 'main_window', // Preload preload: { js: path.join(rootDir, 'src/preload.ts'), }