{"action":"closed","issue":{"url":"https://api.github.com/repos/BrowserSync/browser-sync/issues/1595","repository_url":"https://api.github.com/repos/BrowserSync/browser-sync","labels_url":"https://api.github.com/repos/BrowserSync/browser-sync/issues/1595/labels{/name}","comments_url":"https://api.github.com/repos/BrowserSync/browser-sync/issues/1595/comments","events_url":"https://api.github.com/repos/BrowserSync/browser-sync/issues/1595/events","html_url":"https://github.com/BrowserSync/browser-sync/issues/1595","id":353715146,"node_id":"MDU6SXNzdWUzNTM3MTUxNDY=","number":1595,"title":"browsersync reloads the browser when connection is restored (even though it doesn't need to reload)","user":{"login":"deefeloper","id":13310332,"node_id":"MDQ6VXNlcjEzMzEwMzMy","avatar_url":"https://avatars1.githubusercontent.com/u/13310332?v=4","gravatar_id":"","url":"https://api.github.com/users/deefeloper","html_url":"https://github.com/deefeloper","followers_url":"https://api.github.com/users/deefeloper/followers","following_url":"https://api.github.com/users/deefeloper/following{/other_user}","gists_url":"https://api.github.com/users/deefeloper/gists{/gist_id}","starred_url":"https://api.github.com/users/deefeloper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deefeloper/subscriptions","organizations_url":"https://api.github.com/users/deefeloper/orgs","repos_url":"https://api.github.com/users/deefeloper/repos","events_url":"https://api.github.com/users/deefeloper/events{/privacy}","received_events_url":"https://api.github.com/users/deefeloper/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-08-24T09:42:53Z","updated_at":"2018-10-06T11:45:50Z","closed_at":"2018-10-06T11:45:49Z","author_association":"NONE","body":"### Issue details\r\n\r\nWhen a page has a high load (eg it takes 30 seconds to render) browsersync will have lost it's connection and on reconnect it refreshes, this keeps on going until the server is stopped\r\n\r\n### Steps to reproduce/test case\r\n\r\nuse browsersync, make a page do some heavy lifting for 30 seconds then watch as the page keeps refreshing just after crunching for a while\r\n\r\n### Please specify which version of Browsersync, node and npm you're running\r\n\r\n- Browsersync [ 2.24.6 ]\r\n- Node        [ 8.11.4 ]\r\n- Npm         [ 5.6.0 ]\r\n\r\n### Affected platforms\r\n\r\n- [ ] linux\r\n- [ ] windows\r\n- [ ] OS X\r\n- [ ] freebsd\r\n- [ ] solaris\r\n- [x] other (android on samsung galaxy tab 3)\r\n\r\n### Browsersync use-case\r\n\r\n- [ ] API\r\n- [x] Gulp\r\n- [ ] Grunt\r\n- [ ] CLI\r\n\r\n### If CLI, please paste the entire command below\r\n\r\n{cli command here}\r\n\r\n### for all other use-cases, (gulp, grunt etc), please show us exactly how you're using Browsersync\r\n\r\n```\r\n  browserSync\r\n    .init({\r\n      server: distDir,\r\n      ghostMode: false,\r\n      reloadOnRestart: false,\r\n      port: params.port || config.browserSyncPort || 3000,\r\n      open: (typeof params.openBrowser === 'boolean') && params.openBrowser || config.openBrowser || false,\r\n      middleware: function (req, res, cb) {\r\n        // When using multiple languages, the root does not contain html files\r\n        if (hasMultipleLocales && req.url === '/') {\r\n          res.writeHead(302, { 'Location': `/${config.defaultLanguage || 'en'}/` });\r\n          res.end();\r\n          req.url = `/${config.defaultLanguage || 'en'}/`;\r\n          return;\r\n        }\r\n\r\n        if (req.url.indexOf('.') > -1) {\r\n          return cb();\r\n        }\r\n\r\n        const uri = url.parse(req.url);\r\n\r\n        if (\r\n          uri.pathname.length > 1\r\n          && path.extname(uri.pathname) === ''\r\n          && fs.existsSync(path.join(distDir, uri.pathname + '.html'))\r\n        ) {\r\n          req.url = uri.pathname + '.html' + (uri.search || '');\r\n        }\r\n\r\n        cb();\r\n      }\r\n    });\r\n```\r\n"}}
{"actor":{"display_login":"shakyShane"}}