mirror of
https://github.com/movie-web/extension.git
synced 2025-09-13 12:23:24 +00:00
Less permissions + optional host permissions + no external assets
This commit is contained in:
93
assets/inter/OFL.txt
Normal file
93
assets/inter/OFL.txt
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
Copyright 2020 The Inter Project Authors (https://github.com/rsms/inter)
|
||||||
|
|
||||||
|
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||||
|
This license is copied below, and is also available with a FAQ at:
|
||||||
|
https://openfontlicense.org
|
||||||
|
|
||||||
|
|
||||||
|
-----------------------------------------------------------
|
||||||
|
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||||
|
-----------------------------------------------------------
|
||||||
|
|
||||||
|
PREAMBLE
|
||||||
|
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||||
|
development of collaborative font projects, to support the font creation
|
||||||
|
efforts of academic and linguistic communities, and to provide a free and
|
||||||
|
open framework in which fonts may be shared and improved in partnership
|
||||||
|
with others.
|
||||||
|
|
||||||
|
The OFL allows the licensed fonts to be used, studied, modified and
|
||||||
|
redistributed freely as long as they are not sold by themselves. The
|
||||||
|
fonts, including any derivative works, can be bundled, embedded,
|
||||||
|
redistributed and/or sold with any software provided that any reserved
|
||||||
|
names are not used by derivative works. The fonts and derivatives,
|
||||||
|
however, cannot be released under any other type of license. The
|
||||||
|
requirement for fonts to remain under this license does not apply
|
||||||
|
to any document created using the fonts or their derivatives.
|
||||||
|
|
||||||
|
DEFINITIONS
|
||||||
|
"Font Software" refers to the set of files released by the Copyright
|
||||||
|
Holder(s) under this license and clearly marked as such. This may
|
||||||
|
include source files, build scripts and documentation.
|
||||||
|
|
||||||
|
"Reserved Font Name" refers to any names specified as such after the
|
||||||
|
copyright statement(s).
|
||||||
|
|
||||||
|
"Original Version" refers to the collection of Font Software components as
|
||||||
|
distributed by the Copyright Holder(s).
|
||||||
|
|
||||||
|
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||||
|
or substituting -- in part or in whole -- any of the components of the
|
||||||
|
Original Version, by changing formats or by porting the Font Software to a
|
||||||
|
new environment.
|
||||||
|
|
||||||
|
"Author" refers to any designer, engineer, programmer, technical
|
||||||
|
writer or other person who contributed to the Font Software.
|
||||||
|
|
||||||
|
PERMISSION & CONDITIONS
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||||
|
redistribute, and sell modified and unmodified copies of the Font
|
||||||
|
Software, subject to the following conditions:
|
||||||
|
|
||||||
|
1) Neither the Font Software nor any of its individual components,
|
||||||
|
in Original or Modified Versions, may be sold by itself.
|
||||||
|
|
||||||
|
2) Original or Modified Versions of the Font Software may be bundled,
|
||||||
|
redistributed and/or sold with any software, provided that each copy
|
||||||
|
contains the above copyright notice and this license. These can be
|
||||||
|
included either as stand-alone text files, human-readable headers or
|
||||||
|
in the appropriate machine-readable metadata fields within text or
|
||||||
|
binary files as long as those fields can be easily viewed by the user.
|
||||||
|
|
||||||
|
3) No Modified Version of the Font Software may use the Reserved Font
|
||||||
|
Name(s) unless explicit written permission is granted by the corresponding
|
||||||
|
Copyright Holder. This restriction only applies to the primary font name as
|
||||||
|
presented to the users.
|
||||||
|
|
||||||
|
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||||
|
Software shall not be used to promote, endorse or advertise any
|
||||||
|
Modified Version, except to acknowledge the contribution(s) of the
|
||||||
|
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||||
|
permission.
|
||||||
|
|
||||||
|
5) The Font Software, modified or unmodified, in part or in whole,
|
||||||
|
must be distributed entirely under this license, and must not be
|
||||||
|
distributed under any other license. The requirement for fonts to
|
||||||
|
remain under this license does not apply to any document created
|
||||||
|
using the Font Software.
|
||||||
|
|
||||||
|
TERMINATION
|
||||||
|
This license becomes null and void if any of the above conditions are
|
||||||
|
not met.
|
||||||
|
|
||||||
|
DISCLAIMER
|
||||||
|
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||||
|
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||||
|
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||||
|
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||||
|
OTHER DEALINGS IN THE FONT SOFTWARE.
|
BIN
assets/inter/bold.ttf
Normal file
BIN
assets/inter/bold.ttf
Normal file
Binary file not shown.
BIN
assets/inter/regular.ttf
Normal file
BIN
assets/inter/regular.ttf
Normal file
Binary file not shown.
@@ -44,13 +44,11 @@
|
|||||||
"manifest": {
|
"manifest": {
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"declarativeNetRequest",
|
"declarativeNetRequest",
|
||||||
"tabs",
|
"activeTab",
|
||||||
"cookies"
|
"cookies"
|
||||||
],
|
],
|
||||||
"host_permissions": [
|
"optional_host_permissions": [
|
||||||
"<all_urls>",
|
"<all_urls>"
|
||||||
"https://dev.movie-web.app/*",
|
|
||||||
"https://movie-web.app/*"
|
|
||||||
],
|
],
|
||||||
"browser_specific_settings": {
|
"browser_specific_settings": {
|
||||||
"gecko": {
|
"gecko": {
|
||||||
|
@@ -1,5 +1,3 @@
|
|||||||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@500;800&display=swap');
|
|
||||||
|
|
||||||
html {
|
html {
|
||||||
min-height: 300px;
|
min-height: 300px;
|
||||||
min-width: 300px;
|
min-width: 300px;
|
||||||
@@ -9,7 +7,6 @@ body {
|
|||||||
min-height: 300px;
|
min-height: 300px;
|
||||||
min-width: 300px;
|
min-width: 300px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-family: 'Inter', sans-serif;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup {
|
.popup {
|
||||||
|
@@ -1,17 +1,20 @@
|
|||||||
|
import { useCallback } from 'react';
|
||||||
|
|
||||||
import { Icon } from '~components/Icon';
|
import { Icon } from '~components/Icon';
|
||||||
|
|
||||||
import '~tabs/PermissionGrant.css';
|
import '~tabs/PermissionGrant.css';
|
||||||
|
|
||||||
export interface PermissionMissingProps {
|
export function PermissionMissingScreen() {
|
||||||
onGrant?: () => void;
|
const open = useCallback(() => {
|
||||||
}
|
const url = (chrome || browser).runtime.getURL(`/tabs/PermissionRequest.html`);
|
||||||
|
(chrome || browser).tabs.create({ url });
|
||||||
|
}, []);
|
||||||
|
|
||||||
export function PermissionMissingScreen(props: PermissionMissingProps) {
|
|
||||||
return (
|
return (
|
||||||
<div className="disabled">
|
<div className="disabled">
|
||||||
<Icon name="warningCircle" />
|
<Icon name="warningCircle" />
|
||||||
<p style={{ paddingBottom: 25, paddingTop: 10 }}>The extension is missing permissions it needs to function</p>
|
<p style={{ paddingBottom: 25, paddingTop: 10 }}>The extension is missing permissions it needs to function</p>
|
||||||
<button type="button" className="grant-permission-btn" onClick={props.onGrant}>
|
<button type="button" className="grant-permission-btn" onClick={open}>
|
||||||
Grant Permission
|
Grant Permission
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -2,8 +2,7 @@ import { relayMessage } from '@plasmohq/messaging';
|
|||||||
import type { PlasmoCSConfig } from 'plasmo';
|
import type { PlasmoCSConfig } from 'plasmo';
|
||||||
|
|
||||||
export const config: PlasmoCSConfig = {
|
export const config: PlasmoCSConfig = {
|
||||||
// <all_urls> works for chrome, but not for firefox, so we add explicit domains for firefox
|
matches: ['<all_urls>'],
|
||||||
matches: ['<all_urls>', 'https://dev.movie-web.app/*', 'https://movie-web.app/*'],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
relayMessage({
|
relayMessage({
|
||||||
|
@@ -5,13 +5,15 @@ import { PermissionMissingScreen } from '~components/PermissionMissingScreen';
|
|||||||
import { ToggleButton } from '~components/ToggleButton';
|
import { ToggleButton } from '~components/ToggleButton';
|
||||||
import { useDomain } from '~hooks/useDomain';
|
import { useDomain } from '~hooks/useDomain';
|
||||||
import { useToggleWhitelistDomain } from '~hooks/useDomainWhitelist';
|
import { useToggleWhitelistDomain } from '~hooks/useDomainWhitelist';
|
||||||
import './Popup.css';
|
|
||||||
import { usePermission } from '~hooks/usePermission';
|
import { usePermission } from '~hooks/usePermission';
|
||||||
|
|
||||||
|
import './Popup.css';
|
||||||
|
import './tabs/font.css';
|
||||||
|
|
||||||
function IndexPopup() {
|
function IndexPopup() {
|
||||||
const domain = useDomain();
|
const domain = useDomain();
|
||||||
const { isWhitelisted, toggle } = useToggleWhitelistDomain(domain);
|
const { isWhitelisted, toggle } = useToggleWhitelistDomain(domain);
|
||||||
const { grantPermission, hasPermission } = usePermission();
|
const { hasPermission } = usePermission();
|
||||||
|
|
||||||
let page = 'toggle';
|
let page = 'toggle';
|
||||||
if (!hasPermission) page = 'perm';
|
if (!hasPermission) page = 'perm';
|
||||||
@@ -22,7 +24,7 @@ function IndexPopup() {
|
|||||||
<div className="popup">
|
<div className="popup">
|
||||||
{page === 'toggle' ? <ToggleButton active={isWhitelisted} onClick={toggle} domain={domain} /> : null}
|
{page === 'toggle' ? <ToggleButton active={isWhitelisted} onClick={toggle} domain={domain} /> : null}
|
||||||
{page === 'disabled' ? <DisabledScreen /> : null}
|
{page === 'disabled' ? <DisabledScreen /> : null}
|
||||||
{page === 'perm' ? <PermissionMissingScreen onGrant={grantPermission} /> : null}
|
{page === 'perm' ? <PermissionMissingScreen /> : null}
|
||||||
<BottomLabel />
|
<BottomLabel />
|
||||||
</div>
|
</div>
|
||||||
</Frame>
|
</Frame>
|
||||||
|
@@ -1,10 +1,3 @@
|
|||||||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@500;800&display=swap');
|
|
||||||
|
|
||||||
* {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
html {
|
html {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
@@ -2,6 +2,7 @@ import { useDomainWhitelist } from '~hooks/useDomainWhitelist';
|
|||||||
import { usePermission } from '~hooks/usePermission';
|
import { usePermission } from '~hooks/usePermission';
|
||||||
import { makeUrlIntoDomain } from '~utils/domains';
|
import { makeUrlIntoDomain } from '~utils/domains';
|
||||||
|
|
||||||
|
import './font.css';
|
||||||
import './PermissionGrant.css';
|
import './PermissionGrant.css';
|
||||||
|
|
||||||
export default function PermissionGrant() {
|
export default function PermissionGrant() {
|
||||||
|
0
src/tabs/PermissionRequest.css
Normal file
0
src/tabs/PermissionRequest.css
Normal file
36
src/tabs/PermissionRequest.tsx
Normal file
36
src/tabs/PermissionRequest.tsx
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
import { useCallback } from 'react';
|
||||||
|
|
||||||
|
import { usePermission } from '~hooks/usePermission';
|
||||||
|
|
||||||
|
import './font.css';
|
||||||
|
import './PermissionRequest.css';
|
||||||
|
|
||||||
|
export default function PermissionRequest() {
|
||||||
|
const { grantPermission } = usePermission();
|
||||||
|
|
||||||
|
const grant = useCallback(() => {
|
||||||
|
grantPermission().then(() => window.close());
|
||||||
|
}, [grantPermission]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="container">
|
||||||
|
<div className="inner-container">
|
||||||
|
<h1 className="color-white">Permission</h1>
|
||||||
|
<p className="text-color" style={{ fontSize: 13 }}>
|
||||||
|
Websites need to ask for permission <br /> before they can use this extension
|
||||||
|
</p>
|
||||||
|
<div className="permission-card">
|
||||||
|
<p className="text-color" style={{ textAlign: 'center' }}>
|
||||||
|
The website <span className="color-white">hello world</span> wants to <br /> use the extension on their
|
||||||
|
page.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div className="footer">
|
||||||
|
<button type="button" className="grant-permission-btn" onClick={grant}>
|
||||||
|
Grant Permission
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
24
src/tabs/font.css
Normal file
24
src/tabs/font.css
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
@font-face {
|
||||||
|
font-family: "Inter";
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(data-base64:~assets/inter/regular.ttf) format("ttf");
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: "Inter";
|
||||||
|
font-style: bold;
|
||||||
|
font-weight: 700;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(data-base64:~assets/inter/bold.ttf) format("ttf");
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: "Inter", Arial, Helvetica, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
Reference in New Issue
Block a user