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

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

  •  
  •   zhaol · Feb 24, 2022 · 1304 views
    This topic created in 1549 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
        1
    iPc666  
       Feb 25, 2022 via Android   ❤️ 1
    可以的
    zhaol
        2
    zhaol  
    OP
       Feb 25, 2022
    @iPc666 能说说怎么访问吗
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2813 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 13:22 · PVG 21:22 · LAX 06:22 · JFK 09:22
    ♥ Do have faith in what you're doing.