我弄乱了它,看看我是否可以创建一个扩展。我无法做到,以下内容不起作用,但我想我会分享,以防有人知道丢失的部分。
首先,此功能不属于任何扩展类别(生成器、动态值、导入器)。我尝试使用动态值类别但不成功:
CookieInjector = function(key, value) {
this.key = "XDEBUG_SESSION";
this.value = "PHPSTORM";
this.evaluate = function () {
var f = function (x,y) {
document.cookie=this.key+"="+this.value;
return true;
}
return f(this.key, this.value);
}
// Title function: takes no params, should return the string to display as
// the Dynamic Value title
this.title = function() {
return "Cookie"
}
// Text function: takes no params, should return the string to display as
// the Dynamic Value text
this.text = function() {
return this.key+"="+this.value;
}
}
// Extension Identifier (as a reverse domain name)
CookieInjector.identifier = "com.luckymarmot.PawExtensions.CookieInjector";
// Extension Name
CookieInjector.title = "Inject Cookie Into Cookie Jar";
// Dynamic Value Inputs
CookieInjector.inputs = [
DynamicValueInput("key", "Key", "String"),
DynamicValueInput("value", "Value", "String")
]
// Register this new Extension
registerDynamicValueClass(CookieInjector);
阻止它工作的主要原因是我不确定请求是如何在 PAW 中构建的,也不确定如何附加 cookie。我浏览了这里的文档:https ://luckymarmot.com/paw/doc/Extensions/Reference/Reference ,但找不到我需要的东西。