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

增加对 FireMonkey 支持 #223

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Iey4iej3
Copy link

因为 FireMonkey 把脚本注入 userScript context,比(例如 ViolentMonkey 的 page context)有更严格的隔离,因此需要修改代码以支持。此代码应该并不影响 ViolentMonkey 中的行为。

参见 #94

因为 FireMonkey 把脚本注入 userScript context,比(例如 ViolentMonkey 的 page context)有更严格的隔离,因此需要修改代码以支持。此代码应该并不影响 ViolentMonkey 中的行为。
@Iey4iej3
Copy link
Author

加上 unsafeWindow 是因为 vue 的修改在 page context 里面,而脚本在 FireMonkey 里运行在 userScript context 里面,因此不加上的话无法访问由 vue 扩展的成员。

那个 forEach 会把那个迭代的匿名函数(在 userScript context 里面)传入 page context,进而引发权限错误。 改成 for (... of ...) 就避免了这类问题出现。

@Iey4iej3
Copy link
Author

不好意思,我只把我要用到的 forEach 改成了 for (... of ...),但事实上所有的 selectList.forEach 应该都改成 for (... of selectList)。merge 的时候希望把所有的都改了。

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

Successfully merging this pull request may close these issues.

None yet

1 participant