修改Electron的libcc(libchromiumcontent)源码,重新编译electron, 设置event.isTrusted为true
  0jrBHAPRPwKm 2023年11月02日 52 0

VPN非常注意:

  编译的过程需要使用VPN, 否者chromium的源代码无法下载, 后面会出现总总问题

  Electron的编译环境, 推荐使用物理机:

  win10 64位 英文版, 为了避免后期出现编译文件, 推荐使用64为的win10

  node-v6.11.0-x64, node版本最好在6.x, 高版本的可能编译不成功

  python-2.7.10.amd64, python要求版本2.7.10 , 版本不要太高

  Git, 使用最新版本即可

  vs 2017 community,vs2017  V15.6.7是在线安装, 没法用离线安装包安装, 安装VS的时候要注意把有关c++的安装选项的都选上(visual studio 2017 16.7系列, vs的bug, 否则编译webrtc的时候会报错, 参考:installing-an-earlier-release-of-vs2017​)

下载electron源码

  打开gitbash,或者bash for window ,执行以下代码(请勿使用cmd执行命令, 会出各种问题)

  下载electron源码:

$ git clone https://github.com/electron/electron.git

  清理构建文件:

npm run clean

修改Electron的libcc(libchromiumcontent)源码,重新编译electron, 设置event.isTrusted为true_bc

 

  清理 out 和 dist 目录:

npm run clean-build

 

  更新electron源码,并下载libchromium源码

  注意默认情况下不会以 shared_library 方式编译, 所以你如果使用"--build_release_libcc"参数的话, 只能编译 Electron的 Release 版本, 网速10M的话, 这一步需要半天到一天的时间, 要非常久:

./script/bootstrap.py -v --build_release_libcc

  修改源码的isTrusted, 默认为true

修改Electron的libcc(libchromiumcontent)源码,重新编译electron, 设置event.isTrusted为true_git_02

 

  编译electron的Release版本

./script/build.py -c R

修改Electron的libcc(libchromiumcontent)源码,重新编译electron, 设置event.isTrusted为true_github_03

 

  编译后的文件会出现在 electron\dist\R 目录下,而且编译出来的文件夹大小有1.3G,非常大

  最后再用create-dist.py 打包发行版的electron:

./script/create-dist.py --chromium_dir D:\\compile\\electron\\vendor\\libchromiumcontent\\dist\\main\\static_library

 

修改Electron的libcc(libchromiumcontent)源码,重新编译electron, 设置event.isTrusted为true_git_04

参考:

​  installing-an-earlier-release-of-vs2017​

  ​​electron libchromiumcontent issue​

  ​​How do I link a custom compiled libchromiumcontent with Electron?​

  ​​how-to-submit-a-chromium-patch-to-libchromiumcontent.html​

  ​​-how-do-you-make-a-patch-to-libchromium-content​

  ​​https://bugzilla.mozilla.org/show_bug.cgi?id=1458247​

 


作者: ​​NONO

开源博客:​​http://www.github.com/sqqihao​


天道酬勤



【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月08日 0

暂无评论

推荐阅读
  4koL3J55wyKx   2023年11月13日   38   0   0 icogitCentOS
  9E2BTpjt8nym   2023年12月06日   36   0   0 WindowsgitCentOS
0jrBHAPRPwKm