tridactyl/src/lib/browser_proxy.ts

22 lines
563 B
TypeScript
Raw Normal View History

import { message } from "../messaging"
2017-11-18 01:50:21 +00:00
const browserProxy = new Proxy(Object.create(null), {
get: function(target, api) {
return new Proxy(
{},
{
get: function(_, func) {
return (...args) =>
message("browser_proxy_background", "shim", [
api,
func,
args,
])
},
},
)
},
2017-11-18 01:50:21 +00:00
}) as typeof browser
export default browserProxy