Skip to content

Commit

Permalink
revert back stringification
Browse files Browse the repository at this point in the history
  • Loading branch information
miherlosev committed Jun 20, 2020
1 parent 4e0fbf6 commit 83452d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/browser/connection/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ export default class BrowserConnection extends EventEmitter {
const initScriptPromise = this.initScriptsQueue.shift();

if (initScriptPromise)
initScriptPromise.resolve(data);
initScriptPromise.resolve(JSON.parse(data));
}

public isHeadlessBrowser (): boolean {
Expand Down
4 changes: 2 additions & 2 deletions src/client/browser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function executeInitScript (initScriptUrl, createXHR) {
if (!res.code)
return null;

return sendXHR(initScriptUrl, createXHR, { method: 'POST', data: evaluate(res.code) });
return sendXHR(initScriptUrl, createXHR, { method: 'POST', data: JSON.stringify(evaluate(res.code)) }); //eslint-disable-line no-restricted-globals
})
.then(() => {
window.setTimeout(() => executeInitScript(initScriptUrl, createXHR), 1000);
Expand Down Expand Up @@ -163,6 +163,6 @@ export function getActiveWindowId (activeWindowIdUrl, createXHR) {
export function setActiveWindowId (activeWindowIdUrl, createXHR, windowId) {
return sendXHR(activeWindowIdUrl, createXHR, {
method: 'POST',
data: { windowId }
data: JSON.stringify({ windowId }) //eslint-disable-line no-restricted-globals
});
}

0 comments on commit 83452d9

Please sign in to comment.