{"action":"created","comment":{"url":"https://api.github.com/repos/humphd/brackets-browser-livedev/pulls/comments/24472981","id":24472981,"diff_hunk":"@@ -20,54 +20,50 @@ define(function (require, exports, module) {\n         Launcher             = require(\"lib/Launcher\").Launcher,\n         NoHostServer         = require(\"nohost/src/NoHostServer\").NoHostServer;\n \n-    var _server = new NoHostServer({\n-        pathResolver    : ProjectManager.makeProjectRelativeIfPossible,\n-        root            : ProjectManager.getProjectRoot().fullPath\n-    });\n+    var _server;\n \n     function _getServer() {\n+        if (!_server) {\n+            _server = new NoHostServer({\n+                pathResolver    : ProjectManager.makeProjectRelativeIfPossible,\n+                root            : ProjectManager.getProjectRoot()\n+            });\n+        }\n         return _server;\n     }\n \n-    // First, we configure brackets to run the experimental live dev\n-    // with our nohost server and iframe combination. This has to\n-    // occur before the project is loaded, triggering the start of\n-    // the live preview.\n-    AppInit.extensionsLoaded(function () {\n-        // Flip livedev.multibrowser to true\n-        var prefs = PreferencesManager.getExtensionPrefs(\"livedev\");\n-        prefs.set(\"multibrowser\", true);\n-\n-        // Register nohost server with highest priority\n-        LiveDevServerManager.registerServer({ create: _getServer }, 9001);\n-\n+    // We wait until the LiveDevelopment module is initialized and the project loaded\n+    // so we can safely swap our transport and launcher modules for\n+    // the defaults and start LiveDev.\n+    function _configureLiveDev() {\n         // Turn preview iFrame On\n         Browser.init();\n-    });\n \n-    // Next, we wait until the LiveDevelopment module is initialized\n-    // so we can safely swap our transport and launcher modules for\n-    // the defaults.\n-    function _configureLiveDev() {\n         // Set up our transport and plug it into live-dev\n         PostMessageTransport.setIframe(Browser.getBrowserIframe());\n         LiveDevelopment.setTransport(PostMessageTransport);\n \n         // Set up our launcher in a similar manner\n+        // XXXhumph - this depends on setLauncher() from https://github.com/adobe/brackets/pull/10558\n         LiveDevelopment.setLauncher(new Launcher({\n-            Browser: Browser,\n-            server: _server\n+            browser: Browser,\n+            server: _getServer()\n         }));\n \n-        // Lastly, we wait for brackets to open our project as the last step in\n-        // its loading process.  At this point, we have already configured live preview\n-        // to use an iframe instead of a browser, and we have ensured that\n-        // a file exists to be opened as a project. Once it's opened, we can\n-        // start the live preview.\n-        function _beginLivePreview() {\n-            LiveDevelopment.open();\n-        }\n-        ProjectManager.one(\"projectOpen\", _beginLivePreview);\n+        LiveDevelopment.open();\n     }\n-    LiveDevelopment.one(\"statusChange\", _configureLiveDev);\n+    ProjectManager.one(\"projectOpen\", _configureLiveDev);","path":"main.js","position":69,"original_position":69,"commit_id":"29e3c9209a32c48c1c1696e00f31564fee308d9c","original_commit_id":"29e3c9209a32c48c1c1696e00f31564fee308d9c","user":{"login":"sedge","id":1616860,"avatar_url":"https://avatars.githubusercontent.com/u/1616860?v=3","gravatar_id":"","url":"https://api.github.com/users/sedge","html_url":"https://github.com/sedge","followers_url":"https://api.github.com/users/sedge/followers","following_url":"https://api.github.com/users/sedge/following{/other_user}","gists_url":"https://api.github.com/users/sedge/gists{/gist_id}","starred_url":"https://api.github.com/users/sedge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sedge/subscriptions","organizations_url":"https://api.github.com/users/sedge/orgs","repos_url":"https://api.github.com/users/sedge/repos","events_url":"https://api.github.com/users/sedge/events{/privacy}","received_events_url":"https://api.github.com/users/sedge/received_events","type":"User","site_admin":false},"body":"Nice one on this. ","created_at":"2015-02-11T03:49:26Z","updated_at":"2015-02-11T03:49:26Z","html_url":"https://github.com/humphd/brackets-browser-livedev/pull/8#discussion_r24472981","pull_request_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/humphd/brackets-browser-livedev/pulls/comments/24472981"},"html":{"href":"https://github.com/humphd/brackets-browser-livedev/pull/8#discussion_r24472981"},"pull_request":{"href":"https://api.github.com/repos/humphd/brackets-browser-livedev/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/humphd/brackets-browser-livedev/pulls/8","id":29060303,"html_url":"https://github.com/humphd/brackets-browser-livedev/pull/8","diff_url":"https://github.com/humphd/brackets-browser-livedev/pull/8.diff","patch_url":"https://github.com/humphd/brackets-browser-livedev/pull/8.patch","issue_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/issues/8","number":8,"state":"open","locked":false,"title":"Toward working","user":{"login":"humphd","id":427398,"avatar_url":"https://avatars.githubusercontent.com/u/427398?v=3","gravatar_id":"","url":"https://api.github.com/users/humphd","html_url":"https://github.com/humphd","followers_url":"https://api.github.com/users/humphd/followers","following_url":"https://api.github.com/users/humphd/following{/other_user}","gists_url":"https://api.github.com/users/humphd/gists{/gist_id}","starred_url":"https://api.github.com/users/humphd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/humphd/subscriptions","organizations_url":"https://api.github.com/users/humphd/orgs","repos_url":"https://api.github.com/users/humphd/repos","events_url":"https://api.github.com/users/humphd/events{/privacy}","received_events_url":"https://api.github.com/users/humphd/received_events","type":"User","site_admin":false},"body":"This is a start at getting things to work.  We can't touch `ProjectManager` until it's all done loading the project, so we can't start the server early.  This fixes that.  We also need to open the browser only after the project is open, or it destroys the second pane that holds the iframe.\r\n\r\nI've also fixed a few stray typos, incorrect method calls, etc.  We still have the issue that this is using `setLauncher()` which isn't in Brackets yet.  We either need to merge that into our bramble branch, or somehow do without it.\r\n\r\n@sedge, I'll let you run with this, but I did it as a PR in case you wanted to see what's up.","created_at":"2015-02-11T00:53:02Z","updated_at":"2015-02-11T03:49:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8e25a3f0b7ba34d171134acbaeb9be73f31f1294","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/pulls/8/commits","review_comments_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/pulls/8/comments","review_comment_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/pulls/comments/{number}","comments_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/issues/8/comments","statuses_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/statuses/29e3c9209a32c48c1c1696e00f31564fee308d9c","head":{"label":"humphd:toward-working","ref":"toward-working","sha":"29e3c9209a32c48c1c1696e00f31564fee308d9c","user":{"login":"humphd","id":427398,"avatar_url":"https://avatars.githubusercontent.com/u/427398?v=3","gravatar_id":"","url":"https://api.github.com/users/humphd","html_url":"https://github.com/humphd","followers_url":"https://api.github.com/users/humphd/followers","following_url":"https://api.github.com/users/humphd/following{/other_user}","gists_url":"https://api.github.com/users/humphd/gists{/gist_id}","starred_url":"https://api.github.com/users/humphd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/humphd/subscriptions","organizations_url":"https://api.github.com/users/humphd/orgs","repos_url":"https://api.github.com/users/humphd/repos","events_url":"https://api.github.com/users/humphd/events{/privacy}","received_events_url":"https://api.github.com/users/humphd/received_events","type":"User","site_admin":false},"repo":{"id":30307501,"name":"brackets-browser-livedev","full_name":"humphd/brackets-browser-livedev","owner":{"login":"humphd","id":427398,"avatar_url":"https://avatars.githubusercontent.com/u/427398?v=3","gravatar_id":"","url":"https://api.github.com/users/humphd","html_url":"https://github.com/humphd","followers_url":"https://api.github.com/users/humphd/followers","following_url":"https://api.github.com/users/humphd/following{/other_user}","gists_url":"https://api.github.com/users/humphd/gists{/gist_id}","starred_url":"https://api.github.com/users/humphd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/humphd/subscriptions","organizations_url":"https://api.github.com/users/humphd/orgs","repos_url":"https://api.github.com/users/humphd/repos","events_url":"https://api.github.com/users/humphd/events{/privacy}","received_events_url":"https://api.github.com/users/humphd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/humphd/brackets-browser-livedev","description":"In-Browser Live Development Extension for Brackets","fork":false,"url":"https://api.github.com/repos/humphd/brackets-browser-livedev","forks_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/forks","keys_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/keys{/key_id}","collaborators_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/teams","hooks_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/hooks","issue_events_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/issues/events{/number}","events_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/events","assignees_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/assignees{/user}","branches_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/branches{/branch}","tags_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/tags","blobs_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/git/refs{/sha}","trees_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/git/trees{/sha}","statuses_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/statuses/{sha}","languages_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/languages","stargazers_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/stargazers","contributors_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/contributors","subscribers_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/subscribers","subscription_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/subscription","commits_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/commits{/sha}","git_commits_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/git/commits{/sha}","comments_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/comments{/number}","issue_comment_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/issues/comments/{number}","contents_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/contents/{+path}","compare_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/compare/{base}...{head}","merges_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/merges","archive_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/downloads","issues_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/issues{/number}","pulls_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/pulls{/number}","milestones_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/milestones{/number}","notifications_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/labels{/name}","releases_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/releases{/id}","created_at":"2015-02-04T16:07:00Z","updated_at":"2015-02-10T19:49:03Z","pushed_at":"2015-02-11T00:49:55Z","git_url":"git://github.com/humphd/brackets-browser-livedev.git","ssh_url":"git@github.com:humphd/brackets-browser-livedev.git","clone_url":"https://github.com/humphd/brackets-browser-livedev.git","svn_url":"https://github.com/humphd/brackets-browser-livedev","homepage":null,"size":306,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":3,"forks":5,"open_issues":3,"watchers":1,"default_branch":"master"}},"base":{"label":"humphd:master","ref":"master","sha":"c6ec992c4025334e986ccfa14bc2b50e3651b635","user":{"login":"humphd","id":427398,"avatar_url":"https://avatars.githubusercontent.com/u/427398?v=3","gravatar_id":"","url":"https://api.github.com/users/humphd","html_url":"https://github.com/humphd","followers_url":"https://api.github.com/users/humphd/followers","following_url":"https://api.github.com/users/humphd/following{/other_user}","gists_url":"https://api.github.com/users/humphd/gists{/gist_id}","starred_url":"https://api.github.com/users/humphd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/humphd/subscriptions","organizations_url":"https://api.github.com/users/humphd/orgs","repos_url":"https://api.github.com/users/humphd/repos","events_url":"https://api.github.com/users/humphd/events{/privacy}","received_events_url":"https://api.github.com/users/humphd/received_events","type":"User","site_admin":false},"repo":{"id":30307501,"name":"brackets-browser-livedev","full_name":"humphd/brackets-browser-livedev","owner":{"login":"humphd","id":427398,"avatar_url":"https://avatars.githubusercontent.com/u/427398?v=3","gravatar_id":"","url":"https://api.github.com/users/humphd","html_url":"https://github.com/humphd","followers_url":"https://api.github.com/users/humphd/followers","following_url":"https://api.github.com/users/humphd/following{/other_user}","gists_url":"https://api.github.com/users/humphd/gists{/gist_id}","starred_url":"https://api.github.com/users/humphd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/humphd/subscriptions","organizations_url":"https://api.github.com/users/humphd/orgs","repos_url":"https://api.github.com/users/humphd/repos","events_url":"https://api.github.com/users/humphd/events{/privacy}","received_events_url":"https://api.github.com/users/humphd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/humphd/brackets-browser-livedev","description":"In-Browser Live Development Extension for Brackets","fork":false,"url":"https://api.github.com/repos/humphd/brackets-browser-livedev","forks_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/forks","keys_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/keys{/key_id}","collaborators_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/teams","hooks_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/hooks","issue_events_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/issues/events{/number}","events_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/events","assignees_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/assignees{/user}","branches_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/branches{/branch}","tags_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/tags","blobs_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/git/refs{/sha}","trees_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/git/trees{/sha}","statuses_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/statuses/{sha}","languages_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/languages","stargazers_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/stargazers","contributors_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/contributors","subscribers_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/subscribers","subscription_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/subscription","commits_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/commits{/sha}","git_commits_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/git/commits{/sha}","comments_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/comments{/number}","issue_comment_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/issues/comments/{number}","contents_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/contents/{+path}","compare_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/compare/{base}...{head}","merges_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/merges","archive_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/downloads","issues_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/issues{/number}","pulls_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/pulls{/number}","milestones_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/milestones{/number}","notifications_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/labels{/name}","releases_url":"https://api.github.com/repos/humphd/brackets-browser-livedev/releases{/id}","created_at":"2015-02-04T16:07:00Z","updated_at":"2015-02-10T19:49:03Z","pushed_at":"2015-02-11T00:49:55Z","git_url":"git://github.com/humphd/brackets-browser-livedev.git","ssh_url":"git@github.com:humphd/brackets-browser-livedev.git","clone_url":"https://github.com/humphd/brackets-browser-livedev.git","svn_url":"https://github.com/humphd/brackets-browser-livedev","homepage":null,"size":306,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":3,"forks":5,"open_issues":3,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/humphd/brackets-browser-livedev/pulls/8"},"html":{"href":"https://github.com/humphd/brackets-browser-livedev/pull/8"},"issue":{"href":"https://api.github.com/repos/humphd/brackets-browser-livedev/issues/8"},"comments":{"href":"https://api.github.com/repos/humphd/brackets-browser-livedev/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/humphd/brackets-browser-livedev/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/humphd/brackets-browser-livedev/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/humphd/brackets-browser-livedev/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/humphd/brackets-browser-livedev/statuses/29e3c9209a32c48c1c1696e00f31564fee308d9c"}}}}