question
is intended to write an order evaluation script for your own use, and to listen to Storage, results and find that there is nothing returned at all.
it is suspected that JD.com rewrote the monitoring event of Storage, so it is no problem to monitor Message.
is there any way to solve the problem that there is no result in snooping Storage?
can I rewrite the listening event myself, or write a different listening event?
PS: himself knows that changes to localStorage in the page he is listening to will not work!
related environment
address to execute the script: https://club.jd.com/myJdcomme.
the modification of the localStorage is made from the order page, and the test can be tested from the following two addresses.
0 listening, 1 modify
https://club.jd.com/myJdcomme.
https://club.jd.com/myJdcomme.
case related code
if(/myJdcomment.action/i.test(path)){
var $btn=$(".btn-def"); //
// Storage
console.log(" Storage ");
window.addEventListener("storage", function(e){
console.log("this: ", e);
});
localStorage["myJDorderVocher"]=0;
}
if(/orderVoucher.action/i.test(path)) {
localStorage.setItem("myJDorderVocher","1");
}