From 0e6ccdf6225944f613c5645ad6ed90633fd7d5aa Mon Sep 17 00:00:00 2001 From: Adam Pash Date: Wed, 30 Nov 2016 16:49:18 -0800 Subject: [PATCH] fix: browser cleanup (#35) Cleaning up after the parser when it's done in the browser, before returning result. --- src/mercury.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mercury.js b/src/mercury.js index 8d970115..c79fafc7 100644 --- a/src/mercury.js +++ b/src/mercury.js @@ -86,6 +86,12 @@ const Mercury = { }; } + // if this parse is happening in the browser, + // clean up any trace from the page. + if (cheerio.browser) { + cheerio.cleanup(); + } + return result; },