brenden / node-webshot

Easy website screenshots in Node.js
2.12k stars 286 forks source link

No ability to disable cookies #143

Open anastefan2000 opened 8 years ago

anastefan2000 commented 8 years ago

Even if a cookies: null parameter is provided, the cookies are still not being disabled. This is because the mergeObjects() method in /lib/options.js will ignore the null value and return the default cookies: [].

anastefan2000 commented 8 years ago

On a closer look, even if the null value for cookies clears the mergeObjects() method, it will still be filtered out in the next step, the filterObject() method. One possible solution is to simply require cookies: "none" instead of cookies: null and subsequently have that map to phantom's cookiesEnabled = false. (This would of course require a small API change).