› Get Google Chrome
› Vimium · 在 Chrome 里使用 vim 快捷键
zhaol
V2EX  ›  Chrome

chrome 插件可以查看或者执行原页面的 js 变量和函数吗?

  •  
  •   zhaol · Feb 24, 2022 · 1635 views
    This topic created in 1734 days ago, the information mentioned may be changed or developed.

    假如原页面是 vue 或者 react 写的,在某个组件内定义了一个变量,插件有办法获得这个变量吗?

    我自己做的尝试是把原页面的变量或者函数暴露在全局对象 window 上去,然后通过插件访问 window 对象,但是这么做需要改源代码。有其他的办法吗?

    2 replies  •  2022-02-25 10:21:03 +08:00
    iPc666
    iPc666
    Feb 25, 2022 via Android❤️1
    1
    可以的
    zhaol
    zhaol
    OP
    Feb 25, 2022
    2
    @iPc666 能说说怎么访问吗
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2973 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 00:48 · PVG 08:48 · LAX 16:48 · JFK 19:48
    ♥ Do have faith in what you're doing.