Skip to content

Commit

Permalink
DevTools: trim the leading BOM char when parsing web manifest.
Browse files Browse the repository at this point in the history
BUG=706926

Review-Url: https://codereview.chromium.org/2837943003
Cr-Commit-Position: refs/heads/master@{#466886}
  • Loading branch information
pavelfeldman authored and Commit bot committed Apr 25, 2017
1 parent 7b6b3d6 commit ca395f2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions front_end/resources/AppManifestView.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ Resources.AppManifestView = class extends UI.VBox {
if (!data)
return;

if (data.charCodeAt(0) === 0xFEFF)
data = data.slice(1); // Trim the BOM as per https://tools.ietf.org/html/rfc7159#section-8.1.

var parsedManifest = JSON.parse(data);
this._nameField.textContent = stringProperty('name');
this._shortNameField.textContent = stringProperty('short_name');
Expand Down

0 comments on commit ca395f2

Please sign in to comment.