{"action":"created","comment":{"url":"https://api.github.com/repos/browserhtml/browserhtml/pulls/comments/58166090","id":58166090,"diff_hunk":"@@ -145,6 +150,25 @@ const report =\n     )\n   ];\n \n+const snapshot =\n+  (model) => {\n+    const id = Date.now().toString(32)\n+    const message =\n+      [ `\\n\\n`\n+        , `echo '${JSON.stringify(window.application.model.value)}' > `\n+        , `./dist/snapshot-${id}.json`","path":"src/common/devtools.js","position":29,"original_position":29,"commit_id":"d043ee87dc89305331e6e3e7cc00b007f2a6cd5e","original_commit_id":"d043ee87dc89305331e6e3e7cc00b007f2a6cd5e","user":{"login":"Gozala","id":21236,"avatar_url":"https://avatars.githubusercontent.com/u/21236?v=3","gravatar_id":"","url":"https://api.github.com/users/Gozala","html_url":"https://github.com/Gozala","followers_url":"https://api.github.com/users/Gozala/followers","following_url":"https://api.github.com/users/Gozala/following{/other_user}","gists_url":"https://api.github.com/users/Gozala/gists{/gist_id}","starred_url":"https://api.github.com/users/Gozala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gozala/subscriptions","organizations_url":"https://api.github.com/users/Gozala/orgs","repos_url":"https://api.github.com/users/Gozala/repos","events_url":"https://api.github.com/users/Gozala/events{/privacy}","received_events_url":"https://api.github.com/users/Gozala/received_events","type":"User","site_admin":false},"body":"> servo -w -b --pref dom.mozbrowser.enabled \"file:///Users/paul/git/browserhtml/dist/index.html?replay=/tmp/snapshot-1af86t6v7.json\"\r\n\r\nHmm, I would expect XHR to be disallowed in that case.\r\n\r\nAnyway I'll just dump JSON ;)","created_at":"2016-04-01T06:18:52Z","updated_at":"2016-04-01T06:18:52Z","html_url":"https://github.com/browserhtml/browserhtml/pull/978#discussion_r58166090","pull_request_url":"https://api.github.com/repos/browserhtml/browserhtml/pulls/978","_links":{"self":{"href":"https://api.github.com/repos/browserhtml/browserhtml/pulls/comments/58166090"},"html":{"href":"https://github.com/browserhtml/browserhtml/pull/978#discussion_r58166090"},"pull_request":{"href":"https://api.github.com/repos/browserhtml/browserhtml/pulls/978"}}},"pull_request":{"url":"https://api.github.com/repos/browserhtml/browserhtml/pulls/978","id":64876228,"html_url":"https://github.com/browserhtml/browserhtml/pull/978","diff_url":"https://github.com/browserhtml/browserhtml/pull/978.diff","patch_url":"https://github.com/browserhtml/browserhtml/pull/978.patch","issue_url":"https://api.github.com/repos/browserhtml/browserhtml/issues/978","number":978,"state":"open","locked":false,"title":"Implement record / replay tool for browser.html","user":{"login":"Gozala","id":21236,"avatar_url":"https://avatars.githubusercontent.com/u/21236?v=3","gravatar_id":"","url":"https://api.github.com/users/Gozala","html_url":"https://github.com/Gozala","followers_url":"https://api.github.com/users/Gozala/followers","following_url":"https://api.github.com/users/Gozala/following{/other_user}","gists_url":"https://api.github.com/users/Gozala/gists{/gist_id}","starred_url":"https://api.github.com/users/Gozala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gozala/subscriptions","organizations_url":"https://api.github.com/users/Gozala/orgs","repos_url":"https://api.github.com/users/Gozala/repos","events_url":"https://api.github.com/users/Gozala/events{/privacy}","received_events_url":"https://api.github.com/users/Gozala/received_events","type":"User","site_admin":false},"body":"`cmd-alt-3` will dump a command into terminal invoking which will write a state snapshot file into disk & start a browser.html with it in a state snapshot was taken.\r\n\r\nFor example you can run following into your terminal (presumes PWD is project root):\r\n\r\n```\r\necho '{\"version\":\"0.1.5\",\"mode\":\"create-web-view\",\"shell\":{\"isFocused\":true,\"isMinimized\":false,\"isMaximized\":false,\"controls\":{\"close\":{\"isDisabled\":false,\"isFocused\":false,\"isActive\":false,\"isPointerOver\":false,\"text\":\"\"},\"minimize\":{\"isDisabled\":false,\"isFocused\":false,\"isActive\":false,\"isPointerOver\":false,\"text\":\"\"},\"toggle\":{\"isDisabled\":false,\"isFocused\":false,\"isActive\":false,\"isPointerOver\":false,\"isChecked\":false,\"text\":\"\"}}},\"input\":{\"value\":\"amazon\",\"isFocused\":true,\"isVisible\":true,\"selection\":{\"start\":2,\"end\":6,\"direction\":\"forward\"}},\"assistant\":{\"isOpen\":true,\"isExpanded\":true,\"query\":\"am\",\"search\":{\"query\":\"am\",\"size\":5,\"queryID\":4,\"limit\":5,\"selected\":0,\"matches\":{\"https://duckduckgo.com/?q=amazon\":{\"title\":\"amazon\",\"uri\":\"https://duckduckgo.com/?q=amazon\"},\"https://duckduckgo.com/?q=american%20airlines\":{\"title\":\"american airlines\",\"uri\":\"https://duckduckgo.com/?q=american%20airlines\"},\"https://duckduckgo.com/?q=amazon%20prime\":{\"title\":\"amazon prime\",\"uri\":\"https://duckduckgo.com/?q=amazon%20prime\"},\"https://duckduckgo.com/?q=american%20express\":{\"title\":\"american express\",\"uri\":\"https://duckduckgo.com/?q=american%20express\"},\"https://duckduckgo.com/?q=amtrak\":{\"title\":\"amtrak\",\"uri\":\"https://duckduckgo.com/?q=amtrak\"},\"https://duckduckgo.com/?q=american%20eagle\":{\"title\":\"american eagle\",\"uri\":\"https://duckduckgo.com/?q=american%20eagle\"},\"https://duckduckgo.com/?q=amazon%20books\":{\"title\":\"amazon books\",\"uri\":\"https://duckduckgo.com/?q=amazon%20books\"},\"https://duckduckgo.com/?q=american%20idol\":{\"title\":\"american idol\",\"uri\":\"https://duckduckgo.com/?q=american%20idol\"},\"https://duckduckgo.com/?q=amy%20adams\":{\"title\":\"amy adams\",\"uri\":\"https://duckduckgo.com/?q=amy%20adams\"},\"https://duckduckgo.com/?q=AMC\":{\"title\":\"AMC\",\"uri\":\"https://duckduckgo.com/?q=AMC\"}},\"items\":[\"https://duckduckgo.com/?q=amazon\",\"https://duckduckgo.com/?q=american%20airlines\",\"https://duckduckgo.com/?q=amazon%20prime\",\"https://duckduckgo.com/?q=american%20express\",\"https://duckduckgo.com/?q=amtrak\",\"https://duckduckgo.com/?q=american%20eagle\",\"https://duckduckgo.com/?q=amazon%20books\",\"https://duckduckgo.com/?q=american%20idol\",\"https://duckduckgo.com/?q=amy%20adams\",\"https://duckduckgo.com/?q=AMC\"]},\"history\":{\"query\":\"am\",\"size\":0,\"queryID\":4,\"limit\":5,\"selected\":-1,\"matches\":{},\"items\":[]},\"selected\":-1},\"webViews\":{\"nextID\":0,\"selector\":null,\"order\":[],\"entries\":{},\"display\":{\"depth\":0},\"foldAnimation\":null,\"isFolded\":true},\"sidebar\":{\"isAttached\":false,\"isOpen\":false,\"animation\":null,\"display\":{\"x\":550,\"shadow\":0.5,\"spacing\":16,\"toolbarOpacity\":1,\"titleOpacity\":1,\"tabWidth\":288},\"toolbar\":{\"pin\":{\"isDisabled\":false,\"isFocused\":false,\"isActive\":false,\"isPointerOver\":false,\"isChecked\":false,\"text\":\"\"},\"close\":{\"isDisabled\":false,\"isFocused\":false,\"isActive\":false,\"isPointerOver\":false,\"text\":\"\"}}},\"overlay\":{\"isCapturing\":false,\"isVisible\":false,\"animation\":null,\"display\":{\"opacity\":0}},\"devtools\":{\"isActive\":false,\"settings\":null},\"resizeAnimation\":null,\"display\":{\"rightOffset\":0},\"isExpanded\":true}' > ./dist/snapshot-1af7gd9fj.json && servo -w -b --pref dom.mozbrowser.enabled http://localhost:6060\\?replay\\=snapshot-1af7gd9fj.json\r\n```\r\n\r\nThis will load browser.html in a state I made a snapshot. Alternatively you could generate similar command by executing `cmd-alt-3`.","created_at":"2016-03-31T23:39:04Z","updated_at":"2016-04-01T06:18:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"34dfac726708f3818897f8bc9b387c7cbc3c7923","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/browserhtml/browserhtml/pulls/978/commits","review_comments_url":"https://api.github.com/repos/browserhtml/browserhtml/pulls/978/comments","review_comment_url":"https://api.github.com/repos/browserhtml/browserhtml/pulls/comments{/number}","comments_url":"https://api.github.com/repos/browserhtml/browserhtml/issues/978/comments","statuses_url":"https://api.github.com/repos/browserhtml/browserhtml/statuses/d043ee87dc89305331e6e3e7cc00b007f2a6cd5e","head":{"label":"Gozala:snapshots","ref":"snapshots","sha":"d043ee87dc89305331e6e3e7cc00b007f2a6cd5e","user":{"login":"Gozala","id":21236,"avatar_url":"https://avatars.githubusercontent.com/u/21236?v=3","gravatar_id":"","url":"https://api.github.com/users/Gozala","html_url":"https://github.com/Gozala","followers_url":"https://api.github.com/users/Gozala/followers","following_url":"https://api.github.com/users/Gozala/following{/other_user}","gists_url":"https://api.github.com/users/Gozala/gists{/gist_id}","starred_url":"https://api.github.com/users/Gozala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gozala/subscriptions","organizations_url":"https://api.github.com/users/Gozala/orgs","repos_url":"https://api.github.com/users/Gozala/repos","events_url":"https://api.github.com/users/Gozala/events{/privacy}","received_events_url":"https://api.github.com/users/Gozala/received_events","type":"User","site_admin":false},"repo":{"id":28829395,"name":"browser.html","full_name":"Gozala/browser.html","owner":{"login":"Gozala","id":21236,"avatar_url":"https://avatars.githubusercontent.com/u/21236?v=3","gravatar_id":"","url":"https://api.github.com/users/Gozala","html_url":"https://github.com/Gozala","followers_url":"https://api.github.com/users/Gozala/followers","following_url":"https://api.github.com/users/Gozala/following{/other_user}","gists_url":"https://api.github.com/users/Gozala/gists{/gist_id}","starred_url":"https://api.github.com/users/Gozala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gozala/subscriptions","organizations_url":"https://api.github.com/users/Gozala/orgs","repos_url":"https://api.github.com/users/Gozala/repos","events_url":"https://api.github.com/users/Gozala/events{/privacy}","received_events_url":"https://api.github.com/users/Gozala/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Gozala/browser.html","description":"Experimental browser built in HTML","fork":true,"url":"https://api.github.com/repos/Gozala/browser.html","forks_url":"https://api.github.com/repos/Gozala/browser.html/forks","keys_url":"https://api.github.com/repos/Gozala/browser.html/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Gozala/browser.html/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Gozala/browser.html/teams","hooks_url":"https://api.github.com/repos/Gozala/browser.html/hooks","issue_events_url":"https://api.github.com/repos/Gozala/browser.html/issues/events{/number}","events_url":"https://api.github.com/repos/Gozala/browser.html/events","assignees_url":"https://api.github.com/repos/Gozala/browser.html/assignees{/user}","branches_url":"https://api.github.com/repos/Gozala/browser.html/branches{/branch}","tags_url":"https://api.github.com/repos/Gozala/browser.html/tags","blobs_url":"https://api.github.com/repos/Gozala/browser.html/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Gozala/browser.html/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Gozala/browser.html/git/refs{/sha}","trees_url":"https://api.github.com/repos/Gozala/browser.html/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Gozala/browser.html/statuses/{sha}","languages_url":"https://api.github.com/repos/Gozala/browser.html/languages","stargazers_url":"https://api.github.com/repos/Gozala/browser.html/stargazers","contributors_url":"https://api.github.com/repos/Gozala/browser.html/contributors","subscribers_url":"https://api.github.com/repos/Gozala/browser.html/subscribers","subscription_url":"https://api.github.com/repos/Gozala/browser.html/subscription","commits_url":"https://api.github.com/repos/Gozala/browser.html/commits{/sha}","git_commits_url":"https://api.github.com/repos/Gozala/browser.html/git/commits{/sha}","comments_url":"https://api.github.com/repos/Gozala/browser.html/comments{/number}","issue_comment_url":"https://api.github.com/repos/Gozala/browser.html/issues/comments{/number}","contents_url":"https://api.github.com/repos/Gozala/browser.html/contents/{+path}","compare_url":"https://api.github.com/repos/Gozala/browser.html/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Gozala/browser.html/merges","archive_url":"https://api.github.com/repos/Gozala/browser.html/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Gozala/browser.html/downloads","issues_url":"https://api.github.com/repos/Gozala/browser.html/issues{/number}","pulls_url":"https://api.github.com/repos/Gozala/browser.html/pulls{/number}","milestones_url":"https://api.github.com/repos/Gozala/browser.html/milestones{/number}","notifications_url":"https://api.github.com/repos/Gozala/browser.html/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Gozala/browser.html/labels{/name}","releases_url":"https://api.github.com/repos/Gozala/browser.html/releases{/id}","deployments_url":"https://api.github.com/repos/Gozala/browser.html/deployments","created_at":"2015-01-05T20:07:15Z","updated_at":"2016-02-12T22:23:43Z","pushed_at":"2016-04-01T00:11:12Z","git_url":"git://github.com/Gozala/browser.html.git","ssh_url":"git@github.com:Gozala/browser.html.git","clone_url":"https://github.com/Gozala/browser.html.git","svn_url":"https://github.com/Gozala/browser.html","homepage":null,"size":17360,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"browserhtml:master","ref":"master","sha":"a02afd1a562ea0f87278cf33a50f0d26912aab26","user":{"login":"browserhtml","id":16613745,"avatar_url":"https://avatars.githubusercontent.com/u/16613745?v=3","gravatar_id":"","url":"https://api.github.com/users/browserhtml","html_url":"https://github.com/browserhtml","followers_url":"https://api.github.com/users/browserhtml/followers","following_url":"https://api.github.com/users/browserhtml/following{/other_user}","gists_url":"https://api.github.com/users/browserhtml/gists{/gist_id}","starred_url":"https://api.github.com/users/browserhtml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/browserhtml/subscriptions","organizations_url":"https://api.github.com/users/browserhtml/orgs","repos_url":"https://api.github.com/users/browserhtml/repos","events_url":"https://api.github.com/users/browserhtml/events{/privacy}","received_events_url":"https://api.github.com/users/browserhtml/received_events","type":"Organization","site_admin":false},"repo":{"id":28800891,"name":"browserhtml","full_name":"browserhtml/browserhtml","owner":{"login":"browserhtml","id":16613745,"avatar_url":"https://avatars.githubusercontent.com/u/16613745?v=3","gravatar_id":"","url":"https://api.github.com/users/browserhtml","html_url":"https://github.com/browserhtml","followers_url":"https://api.github.com/users/browserhtml/followers","following_url":"https://api.github.com/users/browserhtml/following{/other_user}","gists_url":"https://api.github.com/users/browserhtml/gists{/gist_id}","starred_url":"https://api.github.com/users/browserhtml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/browserhtml/subscriptions","organizations_url":"https://api.github.com/users/browserhtml/orgs","repos_url":"https://api.github.com/users/browserhtml/repos","events_url":"https://api.github.com/users/browserhtml/events{/privacy}","received_events_url":"https://api.github.com/users/browserhtml/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/browserhtml/browserhtml","description":"Experimental Servo browser built in HTML","fork":false,"url":"https://api.github.com/repos/browserhtml/browserhtml","forks_url":"https://api.github.com/repos/browserhtml/browserhtml/forks","keys_url":"https://api.github.com/repos/browserhtml/browserhtml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/browserhtml/browserhtml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/browserhtml/browserhtml/teams","hooks_url":"https://api.github.com/repos/browserhtml/browserhtml/hooks","issue_events_url":"https://api.github.com/repos/browserhtml/browserhtml/issues/events{/number}","events_url":"https://api.github.com/repos/browserhtml/browserhtml/events","assignees_url":"https://api.github.com/repos/browserhtml/browserhtml/assignees{/user}","branches_url":"https://api.github.com/repos/browserhtml/browserhtml/branches{/branch}","tags_url":"https://api.github.com/repos/browserhtml/browserhtml/tags","blobs_url":"https://api.github.com/repos/browserhtml/browserhtml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/browserhtml/browserhtml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/browserhtml/browserhtml/git/refs{/sha}","trees_url":"https://api.github.com/repos/browserhtml/browserhtml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/browserhtml/browserhtml/statuses/{sha}","languages_url":"https://api.github.com/repos/browserhtml/browserhtml/languages","stargazers_url":"https://api.github.com/repos/browserhtml/browserhtml/stargazers","contributors_url":"https://api.github.com/repos/browserhtml/browserhtml/contributors","subscribers_url":"https://api.github.com/repos/browserhtml/browserhtml/subscribers","subscription_url":"https://api.github.com/repos/browserhtml/browserhtml/subscription","commits_url":"https://api.github.com/repos/browserhtml/browserhtml/commits{/sha}","git_commits_url":"https://api.github.com/repos/browserhtml/browserhtml/git/commits{/sha}","comments_url":"https://api.github.com/repos/browserhtml/browserhtml/comments{/number}","issue_comment_url":"https://api.github.com/repos/browserhtml/browserhtml/issues/comments{/number}","contents_url":"https://api.github.com/repos/browserhtml/browserhtml/contents/{+path}","compare_url":"https://api.github.com/repos/browserhtml/browserhtml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/browserhtml/browserhtml/merges","archive_url":"https://api.github.com/repos/browserhtml/browserhtml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/browserhtml/browserhtml/downloads","issues_url":"https://api.github.com/repos/browserhtml/browserhtml/issues{/number}","pulls_url":"https://api.github.com/repos/browserhtml/browserhtml/pulls{/number}","milestones_url":"https://api.github.com/repos/browserhtml/browserhtml/milestones{/number}","notifications_url":"https://api.github.com/repos/browserhtml/browserhtml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/browserhtml/browserhtml/labels{/name}","releases_url":"https://api.github.com/repos/browserhtml/browserhtml/releases{/id}","deployments_url":"https://api.github.com/repos/browserhtml/browserhtml/deployments","created_at":"2015-01-05T06:39:24Z","updated_at":"2016-03-31T16:19:55Z","pushed_at":"2016-04-01T00:13:36Z","git_url":"git://github.com/browserhtml/browserhtml.git","ssh_url":"git@github.com:browserhtml/browserhtml.git","clone_url":"https://github.com/browserhtml/browserhtml.git","svn_url":"https://github.com/browserhtml/browserhtml","homepage":"","size":62018,"stargazers_count":1563,"watchers_count":1563,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":101,"mirror_url":null,"open_issues_count":71,"forks":101,"open_issues":71,"watchers":1563,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/browserhtml/browserhtml/pulls/978"},"html":{"href":"https://github.com/browserhtml/browserhtml/pull/978"},"issue":{"href":"https://api.github.com/repos/browserhtml/browserhtml/issues/978"},"comments":{"href":"https://api.github.com/repos/browserhtml/browserhtml/issues/978/comments"},"review_comments":{"href":"https://api.github.com/repos/browserhtml/browserhtml/pulls/978/comments"},"review_comment":{"href":"https://api.github.com/repos/browserhtml/browserhtml/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/browserhtml/browserhtml/pulls/978/commits"},"statuses":{"href":"https://api.github.com/repos/browserhtml/browserhtml/statuses/d043ee87dc89305331e6e3e7cc00b007f2a6cd5e"}}}}