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 offscreen to llist of permissions #711

Closed

Conversation

eduardhasanaj
Copy link

I added offscreen permission but unfortunately could not test it.

@changeset-bot
Copy link

changeset-bot bot commented May 8, 2023

⚠️ No Changeset found

Latest commit: 3f63050

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented May 8, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
vite-plugin-docs ⬜️ Ignored (Inspect) May 8, 2023 5:21pm

@eduardhasanaj eduardhasanaj mentioned this pull request May 8, 2023
2 tasks
@filipw01
Copy link

filipw01 commented May 8, 2023

I think it would be great to add all the other missing options in one go. From a quick look I noticed that declarativeNetRequestWithHostAccess is missing and there are probably more https://developer.chrome.com/docs/extensions/mv3/declare_permissions/

@eduardhasanaj
Copy link
Author

@filipw01 if you know how to build the packages in this monorepo please tell me.
Actually for offscreen, we need to modify bundling process so ofscreen html and ts are included in the dist.

@filipw01
Copy link

filipw01 commented May 9, 2023

Sadly I don't know and don't really have much time to dig into it. I didn't know modification of the bundling process is necessary?

I would suspect this should work without any changes to the plugin, are there issues with that?

import html from "./off_screen.html"

chrome.offscreen.createDocument({
  url: chrome.runtime.getURL(html),
  reasons: ['CLIPBOARD'],
  justification: 'reason for needing the document',
});

chrome.offscreen.closeDocument()

References:

@eduardhasanaj
Copy link
Author

@filipw01 thank you very much for your efforts.
You gave me a new direction.
It almost worked.
Inside offscreen html I have a script tag which is not being compiled and throws following error:

RollupError: Unexpected token (Note that you need plugins to import files that are not JavaScript)

My offscreen html:

<script type="module" src="./offscreen.ts"></script>

The exact same line is used in popup html and here the script is compiled.
I am using rollup.

@eduardhasanaj
Copy link
Author

I am closing this as my changes are not added to rollup plugin.

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.

2 participants