Code Monkey home page Code Monkey logo

electronic-wechat's Introduction

hello world 👋

electronic-wechat's People

Contributors

3dseals avatar arrowrowe avatar awmleer avatar boltomli avatar cyio avatar gaocegege avatar geeeeeeeeek avatar gehuangyi20 avatar gucheen avatar gzzhanghao avatar hexchain avatar htc550605125 avatar iamcc avatar iplus26 avatar kulbear avatar larryxiao625 avatar loufq avatar miaowing avatar oblank avatar readmecritic avatar ripples-alive avatar rivershang avatar rocka avatar samurai00 avatar stkevintan avatar viko16 avatar wenliangcan avatar wujysh avatar wzyboy avatar xgdgsc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

electronic-wechat's Issues

ArchLinux Gnome3 环境无法正常使用

扫码后卡在”正在获取最近聊天“
Gnome3托盘只能双击打开窗口,无法用于彻底退出
综上导致无法正常使用且无法退出,只能kill
环境:Archlinux衍生版Manjaro 15.12 +Gnome3

ArchLinux打开报错A JavaScript error occurred in the main process

打开提示:
Uncaught Exception:
TypeError: Error processing argument -1.
at TypeError (native)
at createTray (/usr/share/electronic-wechat/src/main.js:124:13)
at EventEmitter.createWindow (/usr/share/electronic-wechat/src/main.js:94:3)
at emitOne (events.js:82:20)
at EventEmitter.emit (events.js:169:7)

系统ArchLinux衍生版Manjaro,已滚至最新
安装自AUR electronic-wechat-git

二维码扫描确认后没响应

First, make sure your issue is strictly related to the _Electronic WeChat_ project. If it's a question or feature request, you can remove the template below.

Description

二维码扫描后 提示手机上确认,手机上确认后 没响应。。

这个mac版的和官方的客户端有什么区别呢

First, make sure your issue is strictly related to the _Electronic WeChat_ project. If it's a question or feature request, you can remove the template below.

Description

Specifications

  • Version of Electron (run $ electron --version): v0.0.0
  • Version of Node.js (run $ node --version): v0.0.0
  • OS: <OS>
  • Architecture <ARCH>
  • Stack trace from the error message (if any)
<Stack trace here>

网页版微信抓包+注入实现表情贴纸显示

作者:Zhongyi Tong (geeeeeeeeek@github)

协议:知识共享-署名 (CC BY 2.5 AU)

提示: 这是最初的实现方式。#13@arrowrowe 提出了Angular注入的思路,取代了原先的DOM注入,极大地简化了逻辑并提升了性能。这份文档仅供参考。

由于微信协议变动,目前表情商店里的贴纸无法显示。

我们使用网页版微信登录时都会发现,聊天中的表情贴纸都无法显示,被替换成了一段[Sent a sticker. View on phone.]文本,提示你到手机上查看。原本以为微信在下发消息推送时根据终端做了手脚,但抓包的结果表明表情贴纸就在response中,只不过微信出于某些考虑,没有在前端解析出来。

受够了万年不更新bug一大堆的官方微信客户端,我最近用Electron封装了一个Mac和Linux下的WeChat客户端。做了很多本地化的工作,包括自适应窗口、docker上的消息计数,还有就是这个表情贴纸注入,效果如下图所示。由于还没有到production-ready的程度,所以先分享一篇技术文,介绍这个功能的实现。

qq20160224-0 2x

请求分析

为了知道收到的是不是贴纸,以及是什么贴纸,我们先来分析Web WeChat发起的网络请求。打开Chrome的DevTools,Network选项卡,只需要关注XHR请求即可。

qq20160224-1 2x

主要有下面两种请求:

  • GET https://webpush.weixin.qq.com/cgi-bin/mmwebwx-bin/synccheck

    消息的同步请求,HTTP长连接,默认30s或需要同步时返回。

  • POST https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxsync

    上面synccheck请求返回时,也就是有新消息时,微信发起一个webwxsync请求。在这个请求的response中,包含了我们需要的新消息数量AddMsgCount、消息IdMsgId、消息内容Content等等有用的内容。

我们具体看看一个表情贴纸的消息Content是怎样的:

&lt;msg&gt;&lt;emoji fromusername = "wxid_********" tousername = "filehelper" type="2" idbuffer="media:0_0" md5="ead80e721af1faf2bb33054450c61a66" len = "80226" productid="com.tencent.xin.emoticon.bilibili" androidmd5="ead80e721af1faf2bb33054450c61a66" androidlen="80226" s60v3md5 = "ead80e721af1faf2bb33054450c61a66" s60v3len="80226" s60v5md5 = "ead80e721af1faf2bb33054450c61a66" s60v5len="80226" cdnurl = "http://mmbiz.qpic.cn/mmemoticon/dx4Y70y9XctRJf6tKsy7FibsxibBIEComianWNa3zMITfOiaztUNzrgjhg/0" designerid = "" thumburl = "http://mmbiz.qpic.cn/mmemoticon/dx4Y70y9XctRJf6tKsy7F01Cqy3ej686O49bu7YrDWyQ2VPADkeFMg/0" encrypturl = "http://emoji.qpic.cn/wx_emoji/CkibiaVE4Z5fdDEKPW3LEPhPBVFvmicEQhLDWMQNtO6yH7ReGPGtgT44g/" aeskey= "be4577207982f4d793f3586790930af8" &gt;&lt;/emoji&gt; &lt;/msg&gt;

这就很清晰了,头部表明自己是个emoji,然后是一些CheckSum的数据,后面跟着的cdnurl是贴纸的gif资源,thumburl是贴纸的缩略图。理论上拿到这些资源之后,我们就可以在页面中显示贴纸了。

Electron中的抓包

先放一个无关的提醒,如果你想在Electron中嵌入第三方网页,直接用browserWindow.loadURL即可,不要使用官方提供的webview标签。webview标签带来的输入法错位、窗口resize性能问题对产品体验的影响非常严重。

Electron的WebContents提供了did-get-response-details事件,但回调中只能获取到Response Headers,无法获取到Response Body。因此我们需要寻找一些tricky的方法来解决这个问题。我采用的方案是Chrome Debugging Protocol,这其实就是我们日常使用的DevTools为Chrome Apps暴露的一套API。只不过我们平时使用它的UI来调试,现在使用文本命令。

在Electron中我们可以这样连接debugger [docs]

 try {
   browserWindow.webContents.debugger.attach("1.1");
 } catch (err) {
   console.log("Debugger attach failed : ", err);
 }

 browserWindow.webContents.debugger.on('detach', (event, reason) => {
   console.log("Debugger detached due to : ", reason);
 });

 browserWindow.webContents.debugger.on('message', (event, method, params) => {
   if (method == "Network.responseReceived" && params.type == "XHR") {
     // Code here.
   }
 });

 browserWindow.webContents.debugger.sendCommand("Network.enable");

首先注册debugger,然后通过Network.enable开启记录Network日志,接收Network.responseReceived事件,类似于我们在DevTools Network选项卡中看到的请求。查看请求详情需要额外发送一个指令:

debug.sendCommand("Network.getResponseBody", {
        "requestId": requestId
      }, (error, response) => {
        // Code here.
      });

剩余的工作就是用正则表达式和一些逻辑判断从请求中获取到cdnurl,这里不再赘述,可以参考我的代码

Electron中的页面注入

如何在Electron中向WebContents注入代码请参考[文档]。大致思路是在dom-ready和有新的贴纸消息到达时分别注入下面两行代码:

browserWindow.webContents.executeJavaScript(`injectBundle.initEmojiListJS()`);
browserWindow.webContents.executeJavaScript(`injectBundle.updateEmojiListJS('${JSON.stringify(emojiList)}')`);

我们在浏览器环境中维护一个window.emojiList对象,emojiList[msgId] = imageUrl。在DOM中找到div.js_message_bubbledata-cm标签中包含相应msgId的组件,注入background等CSS使其显示贴纸。

我们要对页面上所有可见的贴纸消息气泡执行上述逻辑,因此注入的时机非常重要。Web WeChat是一个由Angular构建的应用,聊天气泡的加载是一个动态的过程,每次切换聊天,甚至是滚动聊天消息时,都会不断有节点的移除和加载。如果新加入的节点有贴纸消息的话,我们就需要及时注入。最后,我采用了一个对性能有些影响的解决方案:

  • 新的贴纸消息到达时替换这个贴纸消息
  • 切换聊天时替换所有贴纸消息
  • 滚动聊天消息时替换所有贴纸消息

下面是注入部分的代码:

injectBundle.replaceEmojiMessageJS = (msgId, imageUrl, delay) => {
  setTimeout(()=> {
    let $bubble = $(`div.js_message_bubble:regex("${msgId}")`)
        .css('background', `url('${imageUrl}') no-repeat`)
        .css('background-size', '120px')
        .css('height', '120px')
        .css('width', '120px');
    $bubble.addClass('no_arrow');
    $bubble.find('pre').text('')
        .css('width', '120px');
  }, delay);
};

injectBundle.updateEmojiListJS = (newList)=> {
  newList = JSON.parse(newList);
  window.emojiList = $.extend(window.emojiList, newList);
  for (let msgId in newList) {
    injectBundle.replaceEmojiMessageJS(msgId, window.emojiList[msgId], 0);
  }
};

injectBundle.initEmojiListJS = ()=> {
  $.expr[':'].regex = (elem, index, match) => {
    var regex = new RegExp(match[3]),
        $elem = $(elem);
    return regex.test($elem.attr('data-cm'));
  };

  window.emojiList = {};
  $('a.title_name').on('DOMSubtreeModified', () => {
    for (let msgId in window.emojiList) {
      injectBundle.replaceEmojiMessageJS(msgId, window.emojiList[msgId], 0);
    }
  });
  $('.chat_bd.scroll-content').on('DOMNodeInserted', (ev) => {
    if (ev.timeStamp - injectBundle.timestamp > 50) {
      injectBundle.timestamp = ev.timeStamp;
      for (let msgId in window.emojiList) {
        injectBundle.replaceEmojiMessageJS(msgId, window.emojiList[msgId], 0);
      }
    }
  })
};

完整的项目请见electronic-wechat

Ubuntu新消息提示问题

Ubuntu下使用时,新消息到达会显示完整的消息,能不能修改为提示有新的消息,而不展示出消息内容呢

Ubuntu下无法彻底退出应用

Description

browserWindow打开的时候下,按下Ctrl - CbrowserWindow隐藏,应用从命令行退出并在后台继续运行。此时能从Tray菜单打开browserWindow,但不使用kill就无法彻底关闭应用。

Specifications

  • OS: Ubuntu

安装失败

Mac OS X EI Capitan node 5.0.0 运行npm install出现以下错误:

npm ERR! Darwin 15.3.0
npm ERR! argv "/usr/local/Cellar/node/5.0.0/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v5.0.0
npm ERR! npm  v3.3.9
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node install.js'.
npm ERR! This is most likely a problem with the electron-prebuilt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node install.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls electron-prebuilt
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/kk/Documents/reposities/electronic-wechat/npm-debug.log

打包后,快捷键不能用,菜单栏不显示

Description

使用npm start运行打开,可以显示菜单栏,也可以使用快捷键。
但是,打包后,菜单栏不显示,快捷键也不能用

Specifications

  • Version of Electron: v0.36.9
  • Version of Node.js : v4.2.1
  • OS: Linux Mint 17.2 Rafaela
  • Architecture: x64

Receiving support?

Hi there! This isn't a issue but I didn't know where to ask!
Are you accepting donations or supports? Because may you get some extra support for wechat, but there is no donate button o something like that.
I don't trying to spam you, but I want to invite you to beerpay.io, a simple platform to monetize open source projects, like electronic-wechat.
I know that the open source is free, but it's okay if someone want to contribute in other way.

Thanks for this work!

nam install fail

First, make sure your issue is strictly related to the _Electronic WeChat_ project. If it's a question or feature request, you can remove the template below.

Description

$ npm install && npm start
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.

[email protected] postinstall /Users/baidu/Documents/MyProj/electronic-wechat/node_modules/electron-prebuilt
node install.js

Downloading electron-v0.36.9-darwin-x64.zip
Error: connect ETIMEDOUT 54.231.2.225:443

/Users/baidu/Documents/MyProj/electronic-wechat/node_modules/electron-prebuilt/install.js:22
throw err
^
Error: connect ETIMEDOUT 54.231.2.225:443
npm ERR! Darwin 15.3.0
npm ERR! argv "/usr/local/Cellar/node/4.2.1/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v4.2.1
npm ERR! npm v2.14.7
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: node install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node install.js'.
npm ERR! This is most likely a problem with the electron-prebuilt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls electron-prebuilt
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/baidu/Documents/MyProj/electronic-wechat/npm-debug.log

Specifications

  • Version of Electron (run $ electron --version): v0.0.0
  • Version of Node.js (run $ node --version): v0.0.0
  • OS: <OS>
  • Architecture <ARCH>
  • Stack trace from the error message (if any)
<Stack trace here>

OSX 10.11.2报错

Description

Steps to Reproduce Issue

Specifications

  • Version of Electron (run $ electron --version): v0.0.0
  • Version of Node.js (run $ node --version): v0.0.0
  • OS: <OS>
  • Architecture <ARCH>
  • Stack trace from the error message (if any)
➜  electronic-wechat git:(master) ✗ npm start

> [email protected] start /Users/Jason/Code/Github/electronic-wechat
> electron src/main.js

fs.js:584
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: ENOENT: no such file or directory, open '/Users/Jason/Code/Github/electronic-wechat/node_modules/electron-prebuilt/path.txt'
    at Error (native)
    at Object.fs.openSync (fs.js:584:18)
    at Object.fs.readFileSync (fs.js:431:33)
    at Object.<anonymous> (/Users/Jason/Code/Github/electronic-wechat/node_modules/electron-prebuilt/index.js:4:42)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)

npm ERR! Darwin 15.2.0
npm ERR! argv "/usr/local/Cellar/node/5.5.0/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v5.5.0
npm ERR! npm  v3.5.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `electron src/main.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'electron src/main.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the electronic-wechat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     electron src/main.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs electronic-wechat
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls electronic-wechat
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/Jason/Code/Github/electronic-wechat/npm-debug.log

[Mac] ⌘+W关闭窗口后会重新加载对话

Description

⌘+W关闭微信窗口后,重新打开electronic-wechat会丢失关闭前相关的对话信息。

Specifications

  • Version of Electron (run $ electron --version): v1.0.1
  • OS: OSX 10.11.3

该程序是nodejs 程序吗

今天把程序下载下来安装到了ubuntu 非常不错,哈哈就是有个小问题,在ubuntu里打开聊天记录的时候,不能显示到底,最后一条消息总显示一半,向下滑动鼠标时聊天页面里面就闪

提供快捷键

希望提供快捷键 如 CMD+Tab进行对话框切换。CMD+F进行搜索。
希望程序启动后,对话框自动 focus。

build fail

Terminal :

npm ERR! Darwin 15.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v4.3.1
npm ERR! npm  v2.14.12
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `electron src/main.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script 'electron src/main.js'.
npm ERR! This is most likely a problem with the electronic-wechat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     electron src/main.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls electronic-wechat
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:

Log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart [email protected]
6 info start [email protected]
7 verbose unsafe-perm in lifecycle true
8 info [email protected] Failed to exec start script
9 verbose stack Error: [email protected] start: `electron src/main.js`
9 verbose stack Exit status 1
9 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:214:16)
9 verbose stack     at emitTwo (events.js:87:13)
9 verbose stack     at EventEmitter.emit (events.js:172:7)
9 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14)
9 verbose stack     at emitTwo (events.js:87:13)
9 verbose stack     at ChildProcess.emit (events.js:172:7)
9 verbose stack     at maybeClose (internal/child_process.js:821:16)
9 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
10 verbose pkgid [email protected]
11 verbose cwd /Users/Oscar/electronic-wechat
12 error Darwin 15.3.0
13 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
14 error node v4.3.1
15 error npm  v2.14.12
16 error code ELIFECYCLE
17 error [email protected] start: `electron src/main.js`
17 error Exit status 1
18 error Failed at the [email protected] start script 'electron src/main.js'.
18 error This is most likely a problem with the electronic-wechat package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error     electron src/main.js
18 error You can get their info via:
18 error     npm owner ls electronic-wechat
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]

Ubuntu上docker的下拉菜单为空

Description

系统是Ubuntu12.04.点击右上角的docker后,只会出现一个内容为空的菜单项,点击之后可以打开微信窗口.设计的时候应该估计至少有打开和关闭两个菜单项. 我这是特殊情况吗?
由于鼠标焦点在docker上时,各种截图方法都不能用,这里就不上图了.
@geeeeeeeeek

Specifications

  • Version of Electron (run $ electron --version): unknown
  • Version of Node.js (run $ node --version): v0.10.37
  • OS: Ubuntu 12.04 LTS
  • Architecture x86_64
  • Stack trace from the error message (if any)

提供截图以及后台保持在线状态

First, make sure your issue is strictly related to the _Electronic WeChat_ project. If it's a question or feature request, you can remove the template below.

Description

希望能参考 mac-wechat 的快捷键:

  1. ctrl + command + w 打开 wechat 主界面
  2. 增加截图功能,保留 ctrl + command + a 截图快捷键

以及,解决后台在线,长时间未使用自动登出的问题。

最后,多谢作者的开发,很美观加油

保留聊天日志

能保留本地的聊天日志,供下次打开的时候查看吗?

支持多微信账号登陆

First, make sure your issue is strictly related to the _Electronic WeChat_ project. If it's a question or feature request, you can remove the template below.

Description

希望可以通过新建窗口等等形式,支持多微信账号登陆(multi-profile?)

Specifications

  • Version of Electron (run $ electron --version): all
  • Version of Node.js (run $ node --version): all
  • OS: all
  • Architecture all
  • Stack trace from the error message (if any)
none

登录成功,页面没有跳转

Description

npm start之后窗口打开,但是扫码后,电脑只显示扫码成功,手机点击登录,电脑没有反应。

执行步骤:

# Clone this repository
git clone https://github.com/geeeeeeeeek/electronic-wechat.git
# Go into the repository
cd electronic-wechat
# Install dependencies and run the app
npm install && npm start
  • OS: Linux

表情会显示[收到了一个表情,请在手机上查看]

Description

表情会显示[收到了一个表情,请在手机上查看]

Steps to Reproduce Issue

不知道哪些表情可以复现,目前是在接收别人发的官方表情,比如Bilibili表情时会出现这样的问题, ❤️ 里的表情是正常的。也有可能是统计样本小,偶尔发生的问题也说不定。。

Specifications

  • Version of Electron (run $ electron --version): v0.4.1
  • Version of Node.js (run $ node --version): v0.10.33
  • OS: OS X 10.11.3
  • Architecture X86(Architecture是指处理器架构么)
  • Stack trace from the error message (if any)
Nothing

表现

Electron Wechat:

Wechat in iPhone:

公众号新窗口打开报错

First, make sure your issue is strictly related to the _Electronic WeChat_ project. If it's a question or feature request, you can remove the template below.

Description

查看公众号的某一文章,右侧窗口下拉菜单中的 ‘New Tab’ 点击报错:

错误信息如图:
截图

Specifications

  • Version of Electron (run $ electron --version): v0.36.9
  • Version of Node.js (run $ node --version): v5.5.0
  • OS: EI Capitan 10.11.13
  • Architecture <ARCH>
  • Stack trace from the error message (if any)
<Stack trace here>

使用统一的窗口风格

现在使用的是系统原生的窗口,看截图在 OSX 下挺好看的,不过在 Linux 下不太好看。不知可不可以设计一个统一的窗口风格?

不知 Electron 支不支持自定义的窗口风格,不过我知道 Node Webkit 是可以的,比如这是 Popcorn Time 的窗口 :
selection_007

这是我系统的原生窗口:

selection_008

聊天图片只能在窗口内打开

聊天时候的图片双击后只能在窗口内放大和移动,这样看图很不方便,能否使用全屏的方式?

  • Version of Electron (run $ electron --version): 0.36.9
  • Version of Node.js (run $ node --version): v0.0.0
  • OS: OS X
  • Architecture <ARCH>
  • Stack trace from the error message (if any)

osxpack.sh脚本

First, make sure your issue is strictly related to the _Electronic WeChat_ project. Some upstream issues caused by _electron_ can be viewed in the guidelines for contributing showing above.

If it's a question or feature request, you can remove the template below.

Description

当前 --version=0.36.7 会报错, 改成--version=0.36.8才能正常打包

Steps to Reproduce Issue

Specifications

  • Version of Electron (run $ electron --version): v0.0.0
  • Version of Node.js (run $ node --version): v0.0.0
  • OS: <OS>
  • Architecture <ARCH>
  • Stack trace from the error message (if any)
<Stack trace here>

WeChat-darwin-x64 Mac下手机扫描后卡在登录界面

First, make sure your issue is strictly related to the _Electronic WeChat_ project. If it's a question or feature request, you can remove the template below.

Description

Pack成APP后,WeChat手机端扫描Mac端的二维码,手机端确认,Mac端没有反应,进入不了聊天页面。请看下图:
screen shot 2016-03-03 at 3 32 48 pm

Specifications

  • Version of Electron (run $ electron --version): v0.36.9
  • Version of Node.js (run $ node --version): v4.3.2
  • OS: Mac OSX 10.11.3
  • Architecture x64

简单贡献一份常量对应表

var e = location.host,
    t = "weixin.qq.com",
    o = "file.wx.qq.com",
    n = "webpush.weixin.qq.com";
var r = navigator.language || navigator.browserLanguage;
r || (r = "zh-cn"), r = r.split("-"), r = r[0].toLowerCase() + "_" + (r[1] || "").toUpperCase();
var a = {
    LANG: r,
    EMOTICON_REG: 'img\\sclass="(qq)?emoji (qq)?emoji([\\da-f]*?)"\\s[^<>]*\\s?',
    RES_PATH: "/zh_CN/htmledition/v2/",
    API_jsLogin: "https://login." + t + "/jslogin?appid=wx782c26e4c19acffb&redirect_uri=" + encodeURIComponent(
        location.protocol + "//" + location.host + "/cgi-bin/mmwebwx-bin/webwxnewloginpage") + "&fun=new&lang=" + r,
    API_login: "https://login." + t + "/cgi-bin/mmwebwx-bin/login",
    API_synccheck: "https://" + n + "/cgi-bin/mmwebwx-bin/synccheck",
    API_webwxdownloadmedia: "https://" + o + "/cgi-bin/mmwebwx-bin/webwxgetmedia",
    API_webwxuploadmedia: "https://" + o + "/cgi-bin/mmwebwx-bin/webwxuploadmedia",
    API_webwxpreview: "/cgi-bin/mmwebwx-bin/webwxpreview",
    API_webwxinit: "/cgi-bin/mmwebwx-bin/webwxinit?r=" + ~new Date,
    API_webwxgetcontact: "/cgi-bin/mmwebwx-bin/webwxgetcontact",
    API_webwxsync: "/cgi-bin/mmwebwx-bin/webwxsync",
    API_webwxbatchgetcontact: "/cgi-bin/mmwebwx-bin/webwxbatchgetcontact",
    API_webwxgeticon: "/cgi-bin/mmwebwx-bin/webwxgeticon",
    API_webwxsendmsg: "/cgi-bin/mmwebwx-bin/webwxsendmsg",
    API_webwxsendmsgimg: "/cgi-bin/mmwebwx-bin/webwxsendmsgimg",
    API_webwxsendemoticon: "/cgi-bin/mmwebwx-bin/webwxsendemoticon",
    API_webwxsendappmsg: "/cgi-bin/mmwebwx-bin/webwxsendappmsg",
    API_webwxgetheadimg: "/cgi-bin/mmwebwx-bin/webwxgetheadimg",
    API_webwxgetmsgimg: "/cgi-bin/mmwebwx-bin/webwxgetmsgimg",
    API_webwxgetmedia: "/cgi-bin/mmwebwx-bin/webwxgetmedia",
    API_webwxgetvideo: "/cgi-bin/mmwebwx-bin/webwxgetvideo",
    API_webwxlogout: "/cgi-bin/mmwebwx-bin/webwxlogout",
    API_webwxgetvoice: "/cgi-bin/mmwebwx-bin/webwxgetvoice",
    API_webwxupdatechatroom: "/cgi-bin/mmwebwx-bin/webwxupdatechatroom",
    API_webwxcreatechatroom: "/cgi-bin/mmwebwx-bin/webwxcreatechatroom",
    API_webwxstatusnotify: "/cgi-bin/mmwebwx-bin/webwxstatusnotify",
    API_webwxcheckurl: "/cgi-bin/mmwebwx-bin/webwxcheckurl",
    API_webwxverifyuser: "/cgi-bin/mmwebwx-bin/webwxverifyuser",
    API_webwxfeedback: "/cgi-bin/mmwebwx-bin/webwxsendfeedback",
    API_webwxreport: "/cgi-bin/mmwebwx-bin/webwxstatreport",
    API_webwxsearch: "/cgi-bin/mmwebwx-bin/webwxsearchcontact",
    API_webwxoplog: "/cgi-bin/mmwebwx-bin/webwxoplog",
    oplogCmdId: {
        TOPCONTACT: 3,
        MODREMARKNAME: 2
    },
    SP_CONTACT_FILE_HELPER: "filehelper",
    SP_CONTACT_NEWSAPP: "newsapp",
    SP_CONTACT_RECOMMEND_HELPER: "fmessage",
    CONTACTFLAG_CONTACT: 1,
    CONTACTFLAG_CHATCONTACT: 2,
    CONTACTFLAG_CHATROOMCONTACT: 4,
    CONTACTFLAG_BLACKLISTCONTACT: 8,
    CONTACTFLAG_DOMAINCONTACT: 16,
    CONTACTFLAG_HIDECONTACT: 32,
    CONTACTFLAG_FAVOURCONTACT: 64,
    CONTACTFLAG_3RDAPPCONTACT: 128,
    CONTACTFLAG_SNSBLACKLISTCONTACT: 256,
    CONTACTFLAG_NOTIFYCLOSECONTACT: 512,
    CONTACTFLAG_TOPCONTACT: 2048,
    MM_USERATTRVERIFYFALG_BIZ: 1,
    MM_USERATTRVERIFYFALG_FAMOUS: 2,
    MM_USERATTRVERIFYFALG_BIZ_BIG: 4,
    MM_USERATTRVERIFYFALG_BIZ_BRAND: 8,
    MM_USERATTRVERIFYFALG_BIZ_VERIFIED: 16,
    MM_DATA_TEXT: 1,
    MM_DATA_HTML: 2,
    MM_DATA_IMG: 3,
    MM_DATA_PRIVATEMSG_TEXT: 11,
    MM_DATA_PRIVATEMSG_HTML: 12,
    MM_DATA_PRIVATEMSG_IMG: 13,
    MM_DATA_VOICEMSG: 34,
    MM_DATA_PUSHMAIL: 35,
    MM_DATA_QMSG: 36,
    MM_DATA_VERIFYMSG: 37,
    MM_DATA_PUSHSYSTEMMSG: 38,
    MM_DATA_QQLIXIANMSG_IMG: 39,
    MM_DATA_POSSIBLEFRIEND_MSG: 40,
    MM_DATA_SHARECARD: 42,
    MM_DATA_VIDEO: 43,
    MM_DATA_VIDEO_IPHONE_EXPORT: 44,
    MM_DATA_EMOJI: 47,
    MM_DATA_LOCATION: 48,
    MM_DATA_APPMSG: 49,
    MM_DATA_VOIPMSG: 50,
    MM_DATA_STATUSNOTIFY: 51,
    MM_DATA_VOIPNOTIFY: 52,
    MM_DATA_VOIPINVITE: 53,
    MM_DATA_MICROVIDEO: 62,
    MM_DATA_SYSNOTICE: 9999,
    MM_DATA_SYS: 1e4,
    MM_DATA_RECALLED: 10002,
    MSGTYPE_TEXT: 1,
    MSGTYPE_IMAGE: 3,
    MSGTYPE_VOICE: 34,
    MSGTYPE_VIDEO: 43,
    MSGTYPE_MICROVIDEO: 62,
    MSGTYPE_EMOTICON: 47,
    MSGTYPE_APP: 49,
    MSGTYPE_VOIPMSG: 50,
    MSGTYPE_VOIPNOTIFY: 52,
    MSGTYPE_VOIPINVITE: 53,
    MSGTYPE_LOCATION: 48,
    MSGTYPE_STATUSNOTIFY: 51,
    MSGTYPE_SYSNOTICE: 9999,
    MSGTYPE_POSSIBLEFRIEND_MSG: 40,
    MSGTYPE_VERIFYMSG: 37,
    MSGTYPE_SHARECARD: 42,
    MSGTYPE_SYS: 1e4,
    MSGTYPE_RECALLED: 10002,
    MSG_SEND_STATUS_READY: 0,
    MSG_SEND_STATUS_SENDING: 1,
    MSG_SEND_STATUS_SUCC: 2,
    MSG_SEND_STATUS_FAIL: 5,
    APPMSGTYPE_TEXT: 1,
    APPMSGTYPE_IMG: 2,
    APPMSGTYPE_AUDIO: 3,
    APPMSGTYPE_VIDEO: 4,
    APPMSGTYPE_URL: 5,
    APPMSGTYPE_ATTACH: 6,
    APPMSGTYPE_OPEN: 7,
    APPMSGTYPE_EMOJI: 8,
    APPMSGTYPE_VOICE_REMIND: 9,
    APPMSGTYPE_SCAN_GOOD: 10,
    APPMSGTYPE_GOOD: 13,
    APPMSGTYPE_EMOTION: 15,
    APPMSGTYPE_CARD_TICKET: 16,
    APPMSGTYPE_REALTIME_SHARE_LOCATION: 17,
    APPMSGTYPE_TRANSFERS: 2e3,
    APPMSGTYPE_RED_ENVELOPES: 2001,
    APPMSGTYPE_READER_TYPE: 100001,
    UPLOAD_MEDIA_TYPE_IMAGE: 1,
    UPLOAD_MEDIA_TYPE_VIDEO: 2,
    UPLOAD_MEDIA_TYPE_AUDIO: 3,
    UPLOAD_MEDIA_TYPE_ATTACHMENT: 4,
    PROFILE_BITFLAG_NOCHANGE: 0,
    PROFILE_BITFLAG_CHANGE: 190,
    CHATROOM_NOTIFY_OPEN: 1,
    CHATROOM_NOTIFY_CLOSE: 0,
    StatusNotifyCode_READED: 1,
    StatusNotifyCode_ENTER_SESSION: 2,
    StatusNotifyCode_INITED: 3,
    StatusNotifyCode_SYNC_CONV: 4,
    StatusNotifyCode_QUIT_SESSION: 5,
    VERIFYUSER_OPCODE_ADDCONTACT: 1,
    VERIFYUSER_OPCODE_SENDREQUEST: 2,
    VERIFYUSER_OPCODE_VERIFYOK: 3,
    VERIFYUSER_OPCODE_VERIFYREJECT: 4,
    VERIFYUSER_OPCODE_SENDERREPLY: 5,
    VERIFYUSER_OPCODE_RECVERREPLY: 6,
    ADDSCENE_PF_QQ: 4,
    ADDSCENE_PF_EMAIL: 5,
    ADDSCENE_PF_CONTACT: 6,
    ADDSCENE_PF_WEIXIN: 7,
    ADDSCENE_PF_GROUP: 8,
    ADDSCENE_PF_UNKNOWN: 9,
    ADDSCENE_PF_MOBILE: 10,
    ADDSCENE_PF_WEB: 33,
    TIMEOUT_SYNC_CHECK: 0,
    EMOJI_FLAG_GIF: 2,
    KEYCODE_BACKSPACE: 8,
    KEYCODE_ENTER: 13,
    KEYCODE_SHIFT: 16,
    KEYCODE_ESC: 27,
    KEYCODE_DELETE: 34,
    KEYCODE_ARROW_LEFT: 37,
    KEYCODE_ARROW_UP: 38,
    KEYCODE_ARROW_RIGHT: 39,
    KEYCODE_ARROW_DOWN: 40,
    KEYCODE_NUM2: 50,
    KEYCODE_AT: 64,
    KEYCODE_NUM_ADD: 107,
    KEYCODE_NUM_MINUS: 109,
    KEYCODE_ADD: 187,
    KEYCODE_MINUS: 189,
    MM_NOTIFY_CLOSE: 0,
    MM_NOTIFY_OPEN: 1,
    MM_SOUND_CLOSE: 0,
    MM_SOUND_OPEN: 1,
    MM_SEND_FILE_STATUS_QUEUED: 0,
    MM_SEND_FILE_STATUS_SENDING: 1,
    MM_SEND_FILE_STATUS_SUCCESS: 2,
    MM_SEND_FILE_STATUS_FAIL: 3,
    MM_SEND_FILE_STATUS_CANCEL: 4,
    MM_EMOTICON_WEB: "_web",

};
var other = {
    RES_IMG_DEFAULT: a.RES_PATH + "images/img.gif",
    RES_IMG_PLACEHOLDER: a.RES_PATH + "images/spacer.gif",
    RES_SOUND_RECEIVE_MSG: a.RES_PATH + "sound/msg.mp3",
    RES_SOUND_SEND_MSG: a.RES_PATH + "sound/text.mp3",
    TIMEOUT_SYNC_CHECK: 3e3,
    API_jsLogin: "/zh_CN/htmledition/v2/api/jsLogin.js",
    API_login: "/zh_CN/htmledition/v2/api/login.js",
    API_webwxinit: "/zh_CN/htmledition/v2/api/webwxinit.json",
    API_webwxgetcontact: "/zh_CN/htmledition/v2/api/webwxgetcontact.json",
    API_webwxsync: "/zh_CN/htmledition/v2/api/webwxsync.json",
    API_synccheck: "/zh_CN/htmledition/v2/api/synccheck.js",
    API_webwxbatchgetcontact: "/zh_CN/htmledition/v2/api/webwxbatchgetcontact.json",
    API_webwxgeticon: "/zh_CN/htmledition/v2/images/webwxgeticon.jpg",
    API_webwxgetheadimg: "/zh_CN/htmledition/v2/images/webwxgeticon.jpg",
    API_webwxgetmsgimg: "/zh_CN/htmledition/v2/images/webwxgeticon.jpg",
    API_webwxgetmedia: "/zh_CN/htmledition/v2/images/webwxgeticon.jpg",
    API_webwxgetvideo: "/zh_CN/htmledition/v2/images/webwxgetvideo.mp4"
};

从微信网页版 js 文件中提取,不能保证长期的有效性

快捷键Ctrl+w的问题

平时习惯了Ctrl+w隐藏窗口,让程序在后台执行,但是在Electronic-wechat上这个操作会导致下次打开的时候又需要重新扫描登录,希望这点能改进一下。

谢谢

Cannot log in on Mac OS X

First, make sure your issue is strictly related to the _Electronic WeChat_ project. If it's a question or feature request, you can remove the template below.

Description

OS version 10.11.4 Beta(15E56a); after QR code scanning my WeChat app on iPhone will report success, but Electronic WeChat will stay at the confirm log in screen.

Specifications

  • Version of Electron (run $ electron --version): v0.0.0
    I can't get version from that command. I used homebrew to install Electron following guide on this site:
    http://macappstore.org/electron/
  • Version of Node.js (run $ node --version): v5.7.0
  • OS: <OS>
  • Architecture <ARCH>
  • Stack trace from the error message (if any)
<Stack trace here>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.