mirror of
https://github.com/bnmgh1/NodeSandbox.git
synced 2025-04-12 03:36:56 +08:00
42 lines
1.3 KiB
JavaScript
42 lines
1.3 KiB
JavaScript
|
|
this.Document_set_cookie = function (val) {
|
|
let r = cbb_wf.checkIllegal(this, "Document");
|
|
let ctx = r[0];
|
|
if (r[1]) {
|
|
throw cbb_wf.newError.call(ctx, "Illegal invocation");
|
|
}
|
|
let dom_element = cbb_wf.getValue(this, "dom_element");
|
|
dom_element.cookie = val;
|
|
if (cbb_wf.is_log) {
|
|
cbb_wf.console.log("[*] Document_set_cookie, this =>", toString.call(this), ", val => ", '' + val);
|
|
}
|
|
}
|
|
|
|
this.Document_get_all = function () {
|
|
let r = cbb_wf.checkIllegal(this, "Document");
|
|
let ctx = r[0];
|
|
if (r[1]) {
|
|
throw cbb_wf.newError.call(ctx, "Illegal invocation");
|
|
}
|
|
let result = cbb_wf.getValue(this, "all");
|
|
if (cbb_wf.is_log) {
|
|
cbb_wf.console.log("[*] Document_get_all, this =>", toString.call(this), ", result => ", result + '');
|
|
}
|
|
return result;
|
|
}
|
|
|
|
this.Document_get_head = function () {
|
|
let r = cbb_wf.checkIllegal(this, "Document");
|
|
let ctx = r[0];
|
|
if (r[1]) {
|
|
throw cbb_wf.newError.call(ctx, "Illegal invocation");
|
|
}
|
|
let dom_element = cbb_wf.getValue(this, "dom_element");
|
|
let result = dom_element.head;
|
|
result = result && ctx.my_api.getWrapperObject(result);
|
|
if (cbb_wf.is_log) {
|
|
cbb_wf.console.log("[*] Document_get_head, this =>", toString.call(this), ", result => ", '' + result);
|
|
}
|
|
return result;
|
|
}
|