Greasy Fork is available in English.

Discussions » Development

库:[ js.hook.js ] javascript钩子

v1
§
Posted: 22/11/2015
Edited: 24/11/2015

库:[ js.hook.js ] javascript钩子

https://greasyfork.org/zh-CN/scripts/14106-js-hook-js

可以修改修改方法接收的参数和返回值
编写扩展网站原有功能的脚本十分有用



§
Posted: 22/11/2015

我都是手动修改 因为相对于底层的 Hook,js 劫持起来实在是太简单 >.>

但是这个写法很美观的样子

文科Mod
§
Posted: 22/11/2015

猴赛雷

§
Posted: 23/11/2015

目测不支持grearemonkey的沙箱?

v1
§
Posted: 23/11/2015

目测不支持grearemonkey的沙箱?

// ==UserScript==
// @name         js.hook.js test
// @namespace    http://tampermonkey.net/
// @match        https://greasyfork.org/*
// @grant        unsafeWindow
// @require https://greasyfork.org/scripts/14106-js-hook-js/code/%5B%20jshookjs%20%5D.js?version=88861
// ==/UserScript==


var hook = hook_js;
hook('unsafeWindow.alert').fakeArg('fakeArg');

Tampermonkey中运行良好

§
Posted: 23/11/2015

目测不支持grearemonkey的沙箱?

// ==UserScript==
// @name         js.hook.js test
// @namespace    http://tampermonkey.net/
// @match        https://greasyfork.org/*
// @grant        unsafeWindow
// @require https://greasyfork.org/scripts/14106-js-hook-js/code/[ jshookjs ].js?version=88861
// ==/UserScript==


var hook = hook_js;
hook('unsafeWindow.alert').fakeArg('fakeArg');

Tampermonkey中运行良好

grearemonkey的沙箱指的应该是 Firefox 下的 GM 插件的沙箱

v1
§
Posted: 24/11/2015

目测不支持grearemonkey的沙箱?

// ==UserScript==
// @name         js.hook.js test
// @namespace    http://tampermonkey.net/
// @match        https://greasyfork.org/*
// @grant        unsafeWindow
// @require https://greasyfork.org/scripts/14106-js-hook-js/code/[ jshookjs ].js?version=88861
// ==/UserScript==


var hook = hook_js;
hook('unsafeWindow.alert').fakeArg('fakeArg');

Tampermonkey中运行良好

grearemonkey的沙箱指的应该是 Firefox 下的 GM 插件的沙箱

嗯,可我又不用ff

Post reply

Sign in to post a reply.