From 5a1ffb9d51bccda5d6c1bd8ac59cf455c179c310 Mon Sep 17 00:00:00 2001 From: aiguigu Date: Tue, 17 May 2022 01:55:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8C=BF=E4=BA=BA=E5=AD=A6=E7=AC=AC5=E9=A2=98-?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 猿人学第5题-hook-cookie/readme.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/猿人学第5题-hook-cookie/readme.md b/猿人学第5题-hook-cookie/readme.md index 53727d1..c5f7aa0 100644 --- a/猿人学第5题-hook-cookie/readme.md +++ b/猿人学第5题-hook-cookie/readme.md @@ -1,5 +1,9 @@ ## 知识点 +hook cookie + +Cookie之所以要新增一个包含固定字符串的判断是因为,cookie经常被修改,这样会断很多次,而我们只想让他断在固定cookie块被设置的时候,因此这么写 + // 方案二 indexOf() 方法可返回某个指定的字符串值在字符串中首次出现的位置。 // ==UserScript== @@ -26,3 +30,27 @@ }) })(); +hook window + + // ==UserScript== + // @name Hook Cookie + // @namespace http://tampermonkey.net/ + // @version 0.1 + // @description pass + // @author ayf + // @run-at document-start + // @match *://match.yuanrenxue.com/* + // @grant none + // ==/UserScript== + + (function () { + 'use strict'; + Object.defineProperty(window, "_$ss", { + set:function(val){ + console.log(11111) + console.warn("hook _$ss", val) + debugger; + return val; + } + }) + })();