-
Notifications
You must be signed in to change notification settings - Fork 18
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
介绍原理 #4
Comments
Closed
我也是刚编程一年的新手,代码写的一般,请多多包涵 |
学习了,大佬 |
这样切换标签页到新的页面,如果旧的页面还有请求一直在进行的话,请求是不是会失败? |
是的,我在kaggle上试过,当你运行kaggle的机器学习程序后切换标签页,他有可能将分配的运行资源回收,并问你are you stiil here,而在正常操作下只有很长时间没有在此页面操作,才会将你的资源回收 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
主要逻辑在src\background\index.ts中
切换功能由handleTabChange实现,原理其实很简单就是在用户切换标签页的时候,先保存旧的页面的 cookies,然后清除旧的页面的cookies,再然后加载新的页面的cookies(如果新的标签页没有已经保存的cookiea就跳过)
至于如何操作cookie,Chrome浏览器提供了对应的api如
chrome.cookies.getAll({ domain: rootDomain })
和await chrome.cookies.set(fixedCookie)
The text was updated successfully, but these errors were encountered: