Ignore reponses not associated with a tab. #223
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes #210 for me. The root cause seems to be that the relationship between frames and service workers has been contentious and shifty over time.
Based on my debugging, when the request to the SharePoint site for a page like
https://...sharepoint.com/.../CollabHome.apsx
is made, the response seen by JSONView has a headercontent-type: application/json
. However, with JSONView disabled, in the browser dev tools network panel, that same response has a headercontent-type: text/html; charset=utf-8
. This makes me suspect JSONView is seeing the response prior to it being transformed by the service worker.The empty JSON responses I see from SharePoint do have
tabId == -1
as mentioned in that linked report. Based on the discussion in that report though I'm not sure how stable that relationship will be. We could instead use a more direct workaround for the parsing issue by ignoring empty JSON documents. I tested that approach too and it does fix SharePoint sites for me. However, if I'm right about the service workers, then such a workaround would carry the risk of an empty JSON response being hydrated by a service worker into a non-empty JSON response that would then be ignored by JSONView. Something to keep in mind if thetabId == -1
condition ever stops working.The same change should be applicable to the chrome code but I don't have a system on hand to test that right now.