{"action":"created","issue":{"url":"https://api.github.com/repos/Atmosphere/atmosphere-javascript/issues/169","labels_url":"https://api.github.com/repos/Atmosphere/atmosphere-javascript/issues/169/labels{/name}","comments_url":"https://api.github.com/repos/Atmosphere/atmosphere-javascript/issues/169/comments","events_url":"https://api.github.com/repos/Atmosphere/atmosphere-javascript/issues/169/events","html_url":"https://github.com/Atmosphere/atmosphere-javascript/pull/169","id":92824974,"number":169,"title":"Prevent Firefox's multiple reconnects during navigation away from current page","user":{"login":"oyvindhorneland","id":1670211,"avatar_url":"https://avatars.githubusercontent.com/u/1670211?v=3","gravatar_id":"","url":"https://api.github.com/users/oyvindhorneland","html_url":"https://github.com/oyvindhorneland","followers_url":"https://api.github.com/users/oyvindhorneland/followers","following_url":"https://api.github.com/users/oyvindhorneland/following{/other_user}","gists_url":"https://api.github.com/users/oyvindhorneland/gists{/gist_id}","starred_url":"https://api.github.com/users/oyvindhorneland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oyvindhorneland/subscriptions","organizations_url":"https://api.github.com/users/oyvindhorneland/orgs","repos_url":"https://api.github.com/users/oyvindhorneland/repos","events_url":"https://api.github.com/users/oyvindhorneland/events{/privacy}","received_events_url":"https://api.github.com/users/oyvindhorneland/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-03T08:44:26Z","updated_at":"2015-07-03T10:04:50Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Atmosphere/atmosphere-javascript/pulls/169","html_url":"https://github.com/Atmosphere/atmosphere-javascript/pull/169","diff_url":"https://github.com/Atmosphere/atmosphere-javascript/pull/169.diff","patch_url":"https://github.com/Atmosphere/atmosphere-javascript/pull/169.patch"},"body":"As discussed in #143.\r\n\r\nIntroducing an internal _beforeUnloadState flag which is set when the beforeunload event occurs. The flag is reset after (currently hardcoded) 5 seconds. If a reconnect occurs when the _beforeUnloadState flag is raised, the reconnect will be delayed for (currently hardcoded) 5 seconds.\r\n\r\nThe goal is to prevent Firefox's multiple reconnects when the user decides to navigate away from the current page while also supporting reconnect if the navigation link did not lead to an unload event (example when using a download link), i.e. the navigation to a new location was cancelled.\r\n\r\nReason for this time delay approach: As far as I know it is not possible to detect a cancelled navigation attempt, i.e. an attempt that triggered beforeunload but will not trigger unload.\r\n\r\nNote: jquery.atmosphere.js has NOT been verified as it is not in use in our application (we use atmosphere.js). Please assist with verification of Firefox using jquery.atmosphere.js."},"comment":{"url":"https://api.github.com/repos/Atmosphere/atmosphere-javascript/issues/comments/118304442","html_url":"https://github.com/Atmosphere/atmosphere-javascript/pull/169#issuecomment-118304442","issue_url":"https://api.github.com/repos/Atmosphere/atmosphere-javascript/issues/169","id":118304442,"user":{"login":"oyvindhorneland","id":1670211,"avatar_url":"https://avatars.githubusercontent.com/u/1670211?v=3","gravatar_id":"","url":"https://api.github.com/users/oyvindhorneland","html_url":"https://github.com/oyvindhorneland","followers_url":"https://api.github.com/users/oyvindhorneland/followers","following_url":"https://api.github.com/users/oyvindhorneland/following{/other_user}","gists_url":"https://api.github.com/users/oyvindhorneland/gists{/gist_id}","starred_url":"https://api.github.com/users/oyvindhorneland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oyvindhorneland/subscriptions","organizations_url":"https://api.github.com/users/oyvindhorneland/orgs","repos_url":"https://api.github.com/users/oyvindhorneland/repos","events_url":"https://api.github.com/users/oyvindhorneland/events{/privacy}","received_events_url":"https://api.github.com/users/oyvindhorneland/received_events","type":"User","site_admin":false},"created_at":"2015-07-03T10:04:50Z","updated_at":"2015-07-03T10:04:50Z","body":"The initial onReopen is an issue in our application. Tested with the pubsub-sample and it reconnects just fine there."}}