{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleChrome/puppeteer/issues/2671","repository_url":"https://api.github.com/repos/GoogleChrome/puppeteer","labels_url":"https://api.github.com/repos/GoogleChrome/puppeteer/issues/2671/labels{/name}","comments_url":"https://api.github.com/repos/GoogleChrome/puppeteer/issues/2671/comments","events_url":"https://api.github.com/repos/GoogleChrome/puppeteer/issues/2671/events","html_url":"https://github.com/GoogleChrome/puppeteer/issues/2671","id":328966477,"node_id":"MDU6SXNzdWUzMjg5NjY0Nzc=","number":2671,"title":"Feature request: create isolated world","user":{"login":"furstenheim","id":8070719,"node_id":"MDQ6VXNlcjgwNzA3MTk=","avatar_url":"https://avatars1.githubusercontent.com/u/8070719?v=4","gravatar_id":"","url":"https://api.github.com/users/furstenheim","html_url":"https://github.com/furstenheim","followers_url":"https://api.github.com/users/furstenheim/followers","following_url":"https://api.github.com/users/furstenheim/following{/other_user}","gists_url":"https://api.github.com/users/furstenheim/gists{/gist_id}","starred_url":"https://api.github.com/users/furstenheim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/furstenheim/subscriptions","organizations_url":"https://api.github.com/users/furstenheim/orgs","repos_url":"https://api.github.com/users/furstenheim/repos","events_url":"https://api.github.com/users/furstenheim/events{/privacy}","received_events_url":"https://api.github.com/users/furstenheim/received_events","type":"User","site_admin":false},"labels":[{"id":601668532,"node_id":"MDU6TGFiZWw2MDE2Njg1MzI=","url":"https://api.github.com/repos/GoogleChrome/puppeteer/labels/feature","name":"feature","color":"1d76db","default":false},{"id":601668536,"node_id":"MDU6TGFiZWw2MDE2Njg1MzY=","url":"https://api.github.com/repos/GoogleChrome/puppeteer/labels/upstream","name":"upstream","color":"dddddd","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-06-04T08:59:40Z","updated_at":"2018-10-23T12:51:05Z","closed_at":null,"author_association":"NONE","body":"I'd like to create an isolated context to execute some js in the same website I'm visiting without polluting the main context. It is possible right now, but it requires to access a lot of internal methods:\r\n\r\n      const mainFrame = page.mainFrame()\r\n\r\n      const isolatedWorldInfo = await page._client.send('Page.createIsolatedWorld', {frameId: mainFrame._id, worldName: 'new-isolated-world'})\r\n      const executionContextId = isolatedWorldInfo.executionContextId\r\n      const JsHandleFactory = page._frameManager.createJSHandle.bind(page._frameManager, executionContextId)\r\n\r\n      const executionContext = new ExecutionContext(page._client, {id: executionContextId}, JsHandleFactory)\r\n      await executionContext.evaluate(..)\r\n\r\n\r\nIt would be nice if puppeteer exposed this as a method. Something like: page.createNewIsolatedContext\r\n\r\nIf necessary I could write up the code and the tests\r\n"},"comment":{"url":"https://api.github.com/repos/GoogleChrome/puppeteer/issues/comments/432233401","html_url":"https://github.com/GoogleChrome/puppeteer/issues/2671#issuecomment-432233401","issue_url":"https://api.github.com/repos/GoogleChrome/puppeteer/issues/2671","id":432233401,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjIzMzQwMQ==","user":{"login":"Janpot","id":2109932,"node_id":"MDQ6VXNlcjIxMDk5MzI=","avatar_url":"https://avatars2.githubusercontent.com/u/2109932?v=4","gravatar_id":"","url":"https://api.github.com/users/Janpot","html_url":"https://github.com/Janpot","followers_url":"https://api.github.com/users/Janpot/followers","following_url":"https://api.github.com/users/Janpot/following{/other_user}","gists_url":"https://api.github.com/users/Janpot/gists{/gist_id}","starred_url":"https://api.github.com/users/Janpot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Janpot/subscriptions","organizations_url":"https://api.github.com/users/Janpot/orgs","repos_url":"https://api.github.com/users/Janpot/repos","events_url":"https://api.github.com/users/Janpot/events{/privacy}","received_events_url":"https://api.github.com/users/Janpot/received_events","type":"User","site_admin":false},"created_at":"2018-10-23T12:51:05Z","updated_at":"2018-10-23T12:51:05Z","author_association":"CONTRIBUTOR","body":"yep, having issues as well running code on websites that override globals, have badly implemented polyfills, run mootools/protoype.js,...\r\nIsolated worlds would solve these for us. A possible API could be to:\r\n```js\r\nawait page.createIsolatedWorld().evaluate(...)\r\n```"}}
{"actor":{"display_login":"Janpot"}}