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

[Feature] support separate GM_s/getValue data by container tabs #2033

Open
ivysrono opened this issue Feb 18, 2024 · 3 comments
Open

[Feature] support separate GM_s/getValue data by container tabs #2033

ivysrono opened this issue Feb 18, 2024 · 3 comments

Comments

@ivysrono
Copy link
Contributor

Motivation

GM_openInTab support container tabs, always open tabs by parent tab's container.

For data transmission between different domains, we use GM_setValue not localStorage.

However, by steps below, data does not been separated:

  1. setValue('username') = 'A' in containerA
  2. setValue('username') = 'B' in containerB
  3. getValue('username') in containerA, get 'B' not 'A'.

Proposed Solution

I'm not sure it's Bug or Feature now. Could you support it?

Use Cases

@tophf
Copy link
Member

tophf commented Feb 18, 2024

I don't see how we can support it. We can't do it by default because it'll be a breaking change and anyway some scripts want to have a unified storage for all containers.

@ivysrono
Copy link
Contributor Author

Do it by options?

BTW, could we support data transmission by GM_openInTab + postMessage or other methods?

I tried, failed.

@tophf
Copy link
Member

tophf commented Feb 18, 2024

We can add sendMessage function (will return a Promise) and onmessage property to the returned value of GM_openInTab, I guess. The opener will use sendMessage and the second script will use onmessage.
@gera2ld?

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

No branches or pull requests

2 participants