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

Add plugin context to get browser storage #101

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Conversation

Codetrauma
Copy link
Contributor

Can get items from local and session storage by their key.

@0xtsukino if you can look this over. Getting an error "Cannot convert undefined to BigInt" when trying to test this in a plugin. I do receive the values of local or session storage, but unsure what the error specifically is coming from.

src/entries/Background/index.ts Outdated Show resolved Hide resolved
src/utils/misc.ts Outdated Show resolved Hide resolved
src/utils/misc.ts Outdated Show resolved Hide resolved
src/utils/misc.ts Outdated Show resolved Hide resolved
@Codetrauma Codetrauma changed the title Added Host Functions for getting Local and Session storage Add plugin context to get browser storage Sep 25, 2024
@Codetrauma
Copy link
Contributor Author

@0xtsukino @heeckhau works now in plugins like we do with headers and cookies using Config.get('storage')['hostname']

@heeckhau
Copy link
Member

heeckhau commented Oct 8, 2024

@Codetrauma can you rebase on alpha.7 before I review?

src/utils/misc.ts Outdated Show resolved Hide resolved
src/utils/misc.ts Outdated Show resolved Hide resolved
src/utils/misc.ts Outdated Show resolved Hide resolved
Co-authored-by: Hendrik Eeckhaut <[email protected]>
src/entries/Background/index.ts Outdated Show resolved Hide resolved
src/entries/Content/index.ts Show resolved Hide resolved
@Codetrauma Codetrauma linked an issue Nov 8, 2024 that may be closed by this pull request
if (config?.sessionStorage) {
const sessionStorage: { [hostname: string]: { [key: string]: string } } =
{};
(async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be await?

if (config?.localStorage) {
const localStorage: { [hostname: string]: { [key: string]: string } } = {};

(async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here - should this be await?

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.

Add Plugin Context to Retrieve Local/Session storage
3 participants