Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pop up页面使用chrome 对象 getBackgroundPage #8

Open
xsawn opened this issue Aug 2, 2018 · 1 comment
Open

pop up页面使用chrome 对象 getBackgroundPage #8

xsawn opened this issue Aug 2, 2018 · 1 comment

Comments

@xsawn
Copy link

xsawn commented Aug 2, 2018

在pop页面如何使用chrome对象啊, 拿不到getbackground page

@DaiwenZh5
Copy link

getBackgroundPage()获取bg对象,但是由于webpack打包时将代码注册到独立的作用域中,因此需要向全局变量上挂载需要开放的变量或方法,如golbal.test = 'hello',这样就可以在其他他页面使用getBackgroundPage().test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants