Skip to content

Commit

Permalink
Fixed an issue when parsing the getUserData json
Browse files Browse the repository at this point in the history
Fixed an issue where a call to decode, with stream set to true
results in an incomplete json object and thus fails to parse it.
  • Loading branch information
Luka Koznjak committed Feb 16, 2020
1 parent de28d8b commit d42a3d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions firefox/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function logListen(details) {
let encoder = new TextEncoder();

filter.ondata = event => {
let str = decoder.decode(event.data, { stream: true });
let str = decoder.decode(event.data, { stream: false });
let json = JSON.parse(str);

json.results = false;
Expand All @@ -21,7 +21,7 @@ function userData(details) {
let encoder = new TextEncoder();

filter.ondata = event => {
let str = decoder.decode(event.data, { stream: true });
let str = decoder.decode(event.data, { stream: false });
let json = JSON.parse(str);
let key = [102, 228, 95, 242, 215, 50, 122, 26, 57, 216, 206, 38, 164, 237, 200, 85];

Expand Down

0 comments on commit d42a3d3

Please sign in to comment.