{"action":"created","issue":{"url":"https://api.github.com/repos/whatwg/fetch/issues/19","labels_url":"https://api.github.com/repos/whatwg/fetch/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/whatwg/fetch/issues/19/comments","events_url":"https://api.github.com/repos/whatwg/fetch/issues/19/events","html_url":"https://github.com/whatwg/fetch/issues/19","id":54100509,"number":19,"title":"XHR option to trigger busy indicators","user":{"login":"stevesouders","id":2819380,"avatar_url":"https://avatars.githubusercontent.com/u/2819380?v=3","gravatar_id":"","url":"https://api.github.com/users/stevesouders","html_url":"https://github.com/stevesouders","followers_url":"https://api.github.com/users/stevesouders/followers","following_url":"https://api.github.com/users/stevesouders/following{/other_user}","gists_url":"https://api.github.com/users/stevesouders/gists{/gist_id}","starred_url":"https://api.github.com/users/stevesouders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevesouders/subscriptions","organizations_url":"https://api.github.com/users/stevesouders/orgs","repos_url":"https://api.github.com/users/stevesouders/repos","events_url":"https://api.github.com/users/stevesouders/events{/privacy}","received_events_url":"https://api.github.com/users/stevesouders/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":45,"created_at":"2015-01-12T20:10:37Z","updated_at":"2015-07-07T01:15:47Z","closed_at":null,"body":"Browsers have default \"busy indicators\" that provide feedback to users that the page is loading, eg, the tab icon, status bar, and reload icon. These busy indicators are triggered in some situations (eg, clicking a link), but not others (eg, issuing an XHR). (See http://www.stevesouders.com/blog/2013/06/16/browser-busy-indicators/.) \r\n\r\nIn the absence of these busy indicators, users are uncertain and thus anxious about the status of pages loading. If the XHR response is slow to arrive and its content is critical to the user experience, the user has no idea that anything is happening. This problem grows as more pages adopt XHRs for core functionality. \r\n\r\nA good example is this article from eBay about how their XHR-based single-page-web-app was perceived as slow until they added a progress bar (http://calendar.perfplanet.com/2014/the-power-of-perceived-performance/). That article also mentions Twitter's approach of adding a throbber to the page when XHRs are fetching tweets. \r\n\r\nWhile requiring developers to add custom progress indicators is a workaround to this problem, it's not ideal because 1) it's more work for developers and 2) each progress indicator is a custom implementation and thus there is not a typical experience for the user that they are trained to look for and expect. \r\n\r\nSince users are \"trained\" to look for the typical busy indicators, these indicators should be triggered when an XHR is issued for content the user is waiting on. However, XHRs are also used for background requests where the busy indicators should NOT be triggered. I suggest we add an option to XMLHttpRequest, eg, showBusy. Setting showBusy=true would explicitly tell the browser to trigger the busy indicators. This would allow for the current behavior (no busy indicators) to be preserved, but also allows an easier and more standard way for developers to use XHR while giving progress feedback to users."},"comment":{"url":"https://api.github.com/repos/whatwg/fetch/issues/comments/119040188","html_url":"https://github.com/whatwg/fetch/issues/19#issuecomment-119040188","issue_url":"https://api.github.com/repos/whatwg/fetch/issues/19","id":119040188,"user":{"login":"duanyao","id":1684137,"avatar_url":"https://avatars.githubusercontent.com/u/1684137?v=3","gravatar_id":"","url":"https://api.github.com/users/duanyao","html_url":"https://github.com/duanyao","followers_url":"https://api.github.com/users/duanyao/followers","following_url":"https://api.github.com/users/duanyao/following{/other_user}","gists_url":"https://api.github.com/users/duanyao/gists{/gist_id}","starred_url":"https://api.github.com/users/duanyao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duanyao/subscriptions","organizations_url":"https://api.github.com/users/duanyao/orgs","repos_url":"https://api.github.com/users/duanyao/repos","events_url":"https://api.github.com/users/duanyao/events{/privacy}","received_events_url":"https://api.github.com/users/duanyao/received_events","type":"User","site_admin":false},"created_at":"2015-07-07T01:15:47Z","updated_at":"2015-07-07T01:15:47Z","body":"@annevk Now I also agree on the promise API proposed by @gaearon, and am glad to hear about #65. Thanks!"}}