{"action":"created","issue":{"url":"https://api.github.com/repos/parro-it/comws/issues/4","repository_url":"https://api.github.com/repos/parro-it/comws","labels_url":"https://api.github.com/repos/parro-it/comws/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/parro-it/comws/issues/4/comments","events_url":"https://api.github.com/repos/parro-it/comws/issues/4/events","html_url":"https://github.com/parro-it/comws/issues/4","id":146518997,"number":4,"title":"\"Converting circular structure to JSON\" error","user":{"login":"ewnd9","id":1713789,"avatar_url":"https://avatars.githubusercontent.com/u/1713789?v=3","gravatar_id":"","url":"https://api.github.com/users/ewnd9","html_url":"https://github.com/ewnd9","followers_url":"https://api.github.com/users/ewnd9/followers","following_url":"https://api.github.com/users/ewnd9/following{/other_user}","gists_url":"https://api.github.com/users/ewnd9/gists{/gist_id}","starred_url":"https://api.github.com/users/ewnd9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ewnd9/subscriptions","organizations_url":"https://api.github.com/users/ewnd9/orgs","repos_url":"https://api.github.com/users/ewnd9/repos","events_url":"https://api.github.com/users/ewnd9/events{/privacy}","received_events_url":"https://api.github.com/users/ewnd9/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-04-07T06:17:56Z","updated_at":"2016-04-07T09:14:51Z","closed_at":null,"body":"Hi, I tried to add [`electron-input-menu`](https://github.com/parro-it/electron-input-menu) to a project, but example code, when I clicked on `<img>` (somehow I thought menu for images was supported)\r\n\r\n```js\r\nconst inputMenu = require('electron-input-menu');\r\nconst context = require('electron-contextmenu-middleware');\r\n\r\ncontext.use(inputMenu);\r\n\r\ncontext.activate();\r\n```\r\n\r\nthrew\r\n\r\n```js\r\nUncaught TypeError: context.run(...).then is not a function  index:12\r\n```\r\n\r\nSo I tried to find out what `context.run` returns and why it doesn't have `then` function \r\n\r\n```js\r\nconsole.log(context.run({menu, elm, click}))\r\n``` \r\n\r\nThis code threw another error (the reason of weird stacktrace is webpack) \r\n\r\n```\r\nTypeError: Converting circular structure to JSON\r\n    at Object.stringify (native)\r\n    at step (http://localhost:8080/app.bundle.js:35536:90)\r\n    at CoMws.run (http://localhost:8080/app.bundle.js:35571:13)\r\n    at run (http://localhost:8080/app.bundle.js:35401:24)\r\n    at HTMLBodyElement.onContextmenu (http://localhost:8080/app.bundle.js:35418:4)\r\n```\r\n\r\nwhich pointed to `comws` and `JSON.stringify` https://github.com/parro-it/comws/blob/64f3fc9927898a0033f82e4c63999e0f402d9e1a/index.js#L78\r\n\r\nAfter I replace `JSON.stringify(ctx)` with just `ctx` there was no error\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/parro-it/comws/issues/comments/206777370","html_url":"https://github.com/parro-it/comws/issues/4#issuecomment-206777370","issue_url":"https://api.github.com/repos/parro-it/comws/issues/4","id":206777370,"user":{"login":"ewnd9","id":1713789,"avatar_url":"https://avatars.githubusercontent.com/u/1713789?v=3","gravatar_id":"","url":"https://api.github.com/users/ewnd9","html_url":"https://github.com/ewnd9","followers_url":"https://api.github.com/users/ewnd9/followers","following_url":"https://api.github.com/users/ewnd9/following{/other_user}","gists_url":"https://api.github.com/users/ewnd9/gists{/gist_id}","starred_url":"https://api.github.com/users/ewnd9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ewnd9/subscriptions","organizations_url":"https://api.github.com/users/ewnd9/orgs","repos_url":"https://api.github.com/users/ewnd9/repos","events_url":"https://api.github.com/users/ewnd9/events{/privacy}","received_events_url":"https://api.github.com/users/ewnd9/received_events","type":"User","site_admin":false},"created_at":"2016-04-07T09:14:51Z","updated_at":"2016-04-07T09:14:51Z","body":"> Nope, I want it to remain focused just on inputs elements. \r\nBut it would be beautiful if you start another module such as electron-image-menu just for images. You could use electron-input-menu as a template for the new module, and I could provide help if you need...\r\n\r\nOk, no problem, thanks for offering help"}}