mirror of
https://github.com/vale981/tridactyl
synced 2025-03-10 12:46:38 -04:00
21 lines
563 B
TypeScript
21 lines
563 B
TypeScript
import { message } from "../messaging"
|
|
|
|
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,
|
|
])
|
|
},
|
|
},
|
|
)
|
|
},
|
|
}) as typeof browser
|
|
|
|
export default browserProxy
|