Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hieyou1/frameover
For when you need a frame over!
https://github.com/hieyou1/frameover
extension extension-chrome extension-firefox extensions iframe iframe-api iframes webextension
Last synced: 27 days ago
JSON representation
For when you need a frame over!
- Host: GitHub
- URL: https://github.com/hieyou1/frameover
- Owner: hieyou1
- License: mit
- Created: 2022-01-06T01:57:06.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-06T15:45:45.000Z (almost 3 years ago)
- Last Synced: 2024-10-04T21:12:47.004Z (about 2 months ago)
- Topics: extension, extension-chrome, extension-firefox, extensions, iframe, iframe-api, iframes, webextension
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# frameover
### For when you need a frame over!## Install
```
npm i frameover
```
```
yarn add frameover
```
```
pnpm install frameover
```
or whatever NPM equivalent you use## Docs, short & simple
```js
const {create} = require("frameover");window.onload = async () => {
// takes in an optional background color in any CSS format [if you end up using it, I'd recommend a shade of gray]
const frame = await create("rgba(0,0,0,0.5)");// do stuff in your frame
frame.document.innerHTML = "";
frame.window.console.log("in a frame!!");// and when you're done, destroy it so the user can get back to the page
frame.destroy();// or pause it and resume later
frame.pause();
setTimeout(frame.resume, 5000);
};
```## Use cases
- Web extension where you need to show something on top of a website without affecting the site's existing JS [cross-origin isolation for the win!]
- There's definitely more but I can't think of them right now## Code
Reused from one of my old projects I never ended up releasing & cleaned up a bit in case anyone else wanted to use it.## Issues
Open an issue or PR.