All Questions
8
questions
0
votes
1
answer
840
views
TypeScript types for Proxy with dynamic properties
I want to type a JavaScript Proxy that allows access to arbitrary properties. A contrived example, an object that maps every property to it's own property name:
const proxy = new Proxy({}, {
get(...
0
votes
1
answer
220
views
Proxy callback function of Chrome extension history API
I would like to proxy the callback function for chrome.history.search to get the history items.
Here is an example:
chrome.history.search({text: '', maxResults: 10}, function(data) {
// ...
});
...
0
votes
0
answers
143
views
Override Chrome Storage API using Proxy object
How can I override chrome.storage.local.get in order to log the value of the storage key when the Chrome Storage API is called using JavaScript Proxy
Here is what I tried:
const api = chrome.storage....
5
votes
0
answers
2k
views
How to create a proxy for HTMLELement
Question
How to create a proxy for browser native DOM object?
Background
I want to intercept the settings for the element style. So I create a proxy for the DOM object. However, it causes error ...
0
votes
0
answers
1k
views
How to use Proxy to intercept every function of an object in JavaScript or E6?
I have a class A, defined like below.(All sample code is simplified for privacy)
class A{
Func1(){
}
Func2(){
}
Func3(){
}
}
And I want to make every function in A ...
1
vote
1
answer
1k
views
Proxy not detecting change on nested array
Module code:
const fs = require('fs');
class database {
constructor(database, object) {
typeof database === "object" && (object = database);
this.file = (typeof database =...
-1
votes
1
answer
1k
views
Javascript ES6 Proxy
I need to create an object that stores another objects. Each property of the big object has two properties 'value' and 'callback'.
let bigObj = {
first: {
value: true,
callback: (...
0
votes
1
answer
180
views
ES6: harmony-proxies: Why does `tracedObj.squared(9)` return undefined?
Why does tracedObj.squared(9) return undefined?
This likely has something to do with the scope of obj being in the wrong scope for it's this call in squared after it calls a method on it's own object....