Safely overriding document.cookie in Google Chrome extension

落爺英雄遲暮 提交于 2019-12-01 12:46:46

var _cookie = document.cookie; is not saving the original getter and setter for cookie, it is just calling the getter and saving the result.

This page (original link, now broken) has an example of how to save the cookie setter and getter:

var cookie_setter = document.__lookupSetter__ ('cookie');
var cookie_getter = document.__lookupGetter__ ('cookie');

You have redefined the orignal cookie getter and setter functions, and there might be a chance that you could have forgotten an important part or implementation of the original functions in the new functions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!