{"action":"created","issue":{"url":"https://api.github.com/repos/cyrus-and/chrome-remote-interface/issues/51","repository_url":"https://api.github.com/repos/cyrus-and/chrome-remote-interface","labels_url":"https://api.github.com/repos/cyrus-and/chrome-remote-interface/issues/51/labels{/name}","comments_url":"https://api.github.com/repos/cyrus-and/chrome-remote-interface/issues/51/comments","events_url":"https://api.github.com/repos/cyrus-and/chrome-remote-interface/issues/51/events","html_url":"https://github.com/cyrus-and/chrome-remote-interface/issues/51","id":178518647,"number":51,"title":"errors from Runtime.evaluate({expression: ''}) are passed unconventionally","user":{"login":"crediblenotand","id":21227710,"avatar_url":"https://avatars.githubusercontent.com/u/21227710?v=3","gravatar_id":"","url":"https://api.github.com/users/crediblenotand","html_url":"https://github.com/crediblenotand","followers_url":"https://api.github.com/users/crediblenotand/followers","following_url":"https://api.github.com/users/crediblenotand/following{/other_user}","gists_url":"https://api.github.com/users/crediblenotand/gists{/gist_id}","starred_url":"https://api.github.com/users/crediblenotand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crediblenotand/subscriptions","organizations_url":"https://api.github.com/users/crediblenotand/orgs","repos_url":"https://api.github.com/users/crediblenotand/repos","events_url":"https://api.github.com/users/crediblenotand/events{/privacy}","received_events_url":"https://api.github.com/users/crediblenotand/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-22T04:19:12Z","updated_at":"2016-09-22T11:52:36Z","closed_at":"2016-09-22T11:52:36Z","body":"inspired from https://github.com/cyrus-and/chrome-har-capturer/blob/a62406a5a32bb6a4ef0b5fbcc8e64fd6dba78552/lib/client.js#L82\r\n\r\nthe following:\r\n\r\n```javascript\r\nchromeInstance.Runtime.evaluate({expression: CLEANUP_SCRIPT})\r\n```\r\n\r\nwill pass the following error to the 2nd argument of the callback or to a `.then`\r\n\r\n```javascript\r\n{ result: \r\n   { type: 'object',\r\n     subtype: 'error',\r\n     className: 'ReferenceError',\r\n     description: 'ReferenceError: chrome is not defined\\n    at <anonymous>:1:1',\r\n     objectId: '{\"injectedScriptId\":1,\"id\":1}' },\r\n  exceptionDetails: \r\n   { exceptionId: 1,\r\n     text: 'Uncaught',\r\n     lineNumber: 0,\r\n     columnNumber: 0,\r\n     scriptId: '30',\r\n     exception: \r\n      { type: 'object',\r\n        subtype: 'error',\r\n        className: 'ReferenceError',\r\n        description: 'ReferenceError: chrome is not defined\\n    at <anonymous>:1:1',\r\n        objectId: '{\"injectedScriptId\":1,\"id\":2}' } } } \r\n```"},"comment":{"url":"https://api.github.com/repos/cyrus-and/chrome-remote-interface/issues/comments/248882037","html_url":"https://github.com/cyrus-and/chrome-remote-interface/issues/51#issuecomment-248882037","issue_url":"https://api.github.com/repos/cyrus-and/chrome-remote-interface/issues/51","id":248882037,"user":{"login":"cyrus-and","id":1660263,"avatar_url":"https://avatars.githubusercontent.com/u/1660263?v=3","gravatar_id":"","url":"https://api.github.com/users/cyrus-and","html_url":"https://github.com/cyrus-and","followers_url":"https://api.github.com/users/cyrus-and/followers","following_url":"https://api.github.com/users/cyrus-and/following{/other_user}","gists_url":"https://api.github.com/users/cyrus-and/gists{/gist_id}","starred_url":"https://api.github.com/users/cyrus-and/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyrus-and/subscriptions","organizations_url":"https://api.github.com/users/cyrus-and/orgs","repos_url":"https://api.github.com/users/cyrus-and/repos","events_url":"https://api.github.com/users/cyrus-and/events{/privacy}","received_events_url":"https://api.github.com/users/cyrus-and/received_events","type":"User","site_admin":false},"created_at":"2016-09-22T11:52:36Z","updated_at":"2016-09-22T11:52:36Z","body":"That happens because JavaScript errors of the [Runtime](https://chromedevtools.github.io/debugger-protocol-viewer/tot/Runtime/#method-evaluate) domain are not errors of the protocol so Chrome sets the `error` argument of the [callback](https://github.com/cyrus-and/chrome-remote-interface#chromesendmethod-params-callback) to `false` and returns the error details in `response`."}}
{"actor":{"display_login":"cyrus-and"}}