New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 799045 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 797712
Owner: ----
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug-Regression



Sign in to add a comment

json file content differently parsed for windows and mac

Reported by tarip...@googlemail.com, Jan 4 2018

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36

Steps to reproduce the problem:
1. ajax call a json file
2. output result in console (inspector console)
3. 

What is the expected behavior?
console log should output the same for chrome on windows and chrome on macs.

What went wrong?
chrome logs the requests result on windows as a json string
chrome logs the requests result on mac as a json object

Did this work before? Yes sometime in november

Chrome version: 63.0.3239.84  Channel: stable
OS Version: 10.0
Flash Version: 

In our project (developed on windows pc) we load the json and then JSON.parse(result) to get the json object for further use. Since chrome on macs seems to automatically convert the files content and parses the reult as a json object the JSON.parse() will fail because the input already is object and not json string.
 
Labels: Needs-Bisect Needs-Triage-M63
Cc: vamshi.k...@techmahindra.com
Labels: Needs-Feedback Triaged-ET
Thanks for filing the issue!

@Reporter: Could you please share a sample test file/URL which helps us to triage the issue in a better way. Any further inputs from your end may help us.
Attached a shortened version of our json file. Here is the code from the section where the different behaviour occures.

$.ajax({
            url: chrome.runtime.getURL(self.getLocalizationBasePath() + self.getLocalization() + '/transifex.json'),
            success: function (result) {
                self.setLanguageConfig(JSON.parse(result));
            },
            error: function () {
                //DO STUFF
            }
        });

It is part of a chrome extension so "chrome.runtime.getURL(self.getLocalizationBasePath() + self.getLocalization() + '/transifex.json')" would point to the location of the file.

With Chrome on Mac the result variable would be of type object already and cause the JSON.parse(result) to fail.With Chrome on Windows result will be of type string. Nothing special.

Tried it on several MacBook Pros and MacBook Airs and different Windows Notebooks (win 10). I doubt it is hardware related tho.
transifex.json
2.0 KB View Download
Project Member

Comment 4 by sheriffbot@chromium.org, Jan 5 2018

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "vamshi.kommuri@techmahindra.com" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Tried to set up a fiddle.
https://jsfiddle.net/yoj5bhyj/
Here it seems that i get the same behaviour on my windows machine as the macs did in our extension.
The loaded file is already an object.
jQuery v3.1.1
It's if on mac the ajax call automatically add the "dataType: 'json'" parameter.
Components: -Blink Platform>Extensions
This behavior only happens in the extension, correct?

I'm guessing that the Windows machine you are using has a MIME type mapping for the .json file type that's not application/json, or perhaps it doesn't have a mapping at all.

File type lookups for files bundled with extensions are sensitive to local configuration.

See also  issue 797712 .
Cc: asanka@chromium.org
Labels: Needs-Feedback
Unable to reproduce the issue on reported chrome version 63.0.3239.84 and on the latest canary 65.0.3312.0 using windows 10 with the below mentioned steps.
1. Launched chrome
2. Navigated to https://jsfiddle.net/yoj5bhyj/
3. Opened Dev tools>console
We are able to see the result as an object. Attaching the screen cast of the same.

@Reporter: Could you please check the screen cast and let us know if we have missed any steps. And please respond to comment#8.

Thanks!
799045.mp4
2.8 MB View Download
Sry I might have been a bit confusing. I got the same result in the fiddle as you.
The thing mentioned in Comment 8 might be the reason for the wierd behaviour. I can just reproduce the different result formats in chrome extensions.

Made a small test extension for you to try out. My console on windows looks like the screenshot.
In the example i have 2 ajax calls one with dataType specified and one without.
issue-799045.zip
87.4 KB Download
issue-799045.PNG
36.9 KB View Download
Project Member

Comment 13 by sheriffbot@chromium.org, Jan 8 2018

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "vamshi.kommuri@techmahindra.com" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Unable to reproduce the issue on chrome reported version 63.0.3239.84 and latest canary 65.0.3316.0 with steps mentioned below:
1) Launched chrome reported version and added extension provided in comment# 12
2) Navigated to fiddle: https://jsfiddle.net/yoj5bhyj/
3) Open Devtools -> console, we are seeing output in the console as "request failed > Object"
Now we are seeing the same behaviour of the fiddle without adding the extension provided in comment# 12

@Reporter:
Please find the attached screen cast for your reference and let us know if we missed anything in reproducing the issue, please provide your inputs on it.

Thanks!
799045.mp4
8.2 MB View Download
Cc: viswatej...@techmahindra.com sc00335...@techmahindra.com
Labels: M-65 OS-Linux OS-Mac
Status: Untriaged (was: Unconfirmed)
Labels: -OS-Linux -OS-Mac -M-65 Needs-Feedback
Status: Unconfirmed (was: Untriaged)
Sry I was unclear once more. With the installed extension just open up any page that matches "https://mail.google.com/*" or "https://inbox.google.com/*
In the console drawer of the dev tools you should then hopefully be able to see the logs as in my screenshot.

1. install and enable the extension
2. navigate to "https://mail.google.com/"
3. if redirected to login page ("https://accounts.google.com") sign into any account ("https://accounts.google.com" not included for the content script, sry)
4. Opened Dev tools>console
Project Member

Comment 18 by sheriffbot@chromium.org, Jan 9 2018

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "sc00335628@techmahindra.com" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: Needs-Feedback
We are able to see a similar output with a slight difference in console as per attachment in comment#12 by reporter. Checked the issue on windows 10 on chrome version 63.0.3239.84 with the below mentioned steps.
1. Launched chrome
2. Downloaded/added extension
3. Navigated to https://mail.google.com/
4. Opened Dev Tools>Console
Attaching the screen shot for confirmation.

@Reporter:  We got the output result as "Object", Clearly shown/marked in attached file. Could you please have a look at the attachment and let us know whether that is the expected result or is it an issue.

Thanks!
799045 screen shot object.png
83.3 KB View Download
This is correct, the second part of the log should always be object (hence "should be object").
Project Member

Comment 21 by sheriffbot@chromium.org, Jan 10 2018

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "vamshi.kommuri@techmahindra.com" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Needs-Bisect Needs-Feedback
@Reporter: Thanks for the confirmation given about the screen shot attached in comment#19. As the issue is not reproducible from TE end, hence removing Needs-Bisect label and requesting you to try the same issue on a fresh profile/new person. Please let us know if the issue still persists even after checking in a new profile.

Thanks! 
Mergedinto: 797712
Status: Duplicate (was: Unconfirmed)
Merging into  issue 797712  which addresses the same root cause.

Sign in to add a comment