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
add GM.getTab and GM.saveTab #296
Conversation
these api are available in tampermonkey and used by my scripts,so add these to userscripts also. |
Thanks for the PR @maggch97 ! I've not used this API in the past. What's the main use case for it? It looks like it's so that usescripts can share data with one another, this correct? |
for my usage,i use this api to persist the state for tab. if user refresh the page or jump to new page with different host,script can recover from the previous tan state. |
Thanks for the clarification. I just want to make sure on one more thing. In the readme you say:
On tab |
according to the implementation in tampermonkey, we don't need to clear the object. |
right, but we can clear the object when tab closes? Tampermonkey has a persistent background page, Userscripts has a non-persistent background page (this is an iOS requirement). So we should not store I think |
Thanks for your information because i am not familiar with Safari and iOS,please let me do some investigation |
but I don't think sessionStorage can be used here,because pages from different hosts like google and github can't share their sessionStorage. Howerver,We can open different host pages in a same tab one by one |
We could use the The background It would be ideal to clear the tab data when the tab is closed, but I am not sure it's worth have |
@maggch97 I made the changes to your pull request, below are noted on what I did, please let me know if any of the changes conflict with the API, thanks again for the contribution:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some minor changes needed but I added additional commits
@quoid sorry, I didn't see your comment before and force push now. I think you changes won't conflict with the API |
merging this into the |
No description provided.