Skip to content

Commit

Permalink
Merge pull request #15 from 2coolchampion/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
2coolchampion committed Dec 15, 2023
2 parents 230f3db + 79ad2fb commit 53d132b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/pages/background/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ chrome.runtime.onInstalled.addListener(async () => {
matches: ['*://*/*'],
js: ["src/pages/content/index.js"],
// KEY for cache invalidation
css: ["Global.chunk.css"],
// css: ["assets/css/contentStyle.chunk.css"],
}]).then(async () => {
const registeredScripts = await chrome.scripting.getRegisteredContentScripts();
Expand Down
4 changes: 3 additions & 1 deletion src/pages/content/components/Demo/app.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useEffect } from "react";
import Styles from "@src/global.css";

export default function App() {
useEffect(() => {
Expand All @@ -7,8 +8,9 @@ export default function App() {

return (
<>
<style>{Styles}</style>
<div
className="text-lime-400 p-4 w-screen bg-red-400"
className="text-lime-400 p-4 w-screen bg-red-400 font-sans" // Need to set the font family because otherwise it would inherit from website.
>
content view
<button
Expand Down
2 changes: 0 additions & 2 deletions src/pages/content/components/Demo/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { createRoot } from "react-dom/client";
import '../../../../global.css'
import App from "@src/pages/content/components/Demo/app";
import refreshOnUpdate from "virtual:reload-on-update-in-view";

refreshOnUpdate("pages/content");

const root = document.createElement("div");
root.id = "fictional-fortnight-content-view-root";
root.style.all = "unset";

document.body.append(root);

Expand Down
6 changes: 4 additions & 2 deletions src/pages/popup/Popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const Popup = () => {
updatedList.map((site) => `*://${site}/*`) :
whitelist.map((site) => `*://${site}/*`),
js: ["src/pages/content/index.js"],
css: ["./assets/css/_virtual_reload-on-update-in-view.chunk.css"],
}
])
} else if (mode === 'blacklist') {
Expand All @@ -78,6 +79,7 @@ const Popup = () => {
updatedList.map((site) => `*://${site}/*`) :
blacklist.map((site) => `*://${site}/*`),
js: ["src/pages/content/index.js"],
css: ["./assets/css/_virtual_reload-on-update-in-view.chunk.css"],
}
])
}
Expand Down Expand Up @@ -282,14 +284,14 @@ const Popup = () => {
const renderButton = () => {
if (isOnList()) {
return (
<button className="text-sm p-1 border-1 border-red-500" onClick={removeFromList}>
<button className="text-sm p-1 border border-red-500" onClick={removeFromList}>
-
{currentSiteHostname}
</button>
);
} else {
return (
<button className="text-sm p-1 border-1 border-green-500" onClick={addToList}>
<button className="text-sm p-1 border border-green-500" onClick={addToList}>
+
{currentSiteHostname}
</button>
Expand Down

0 comments on commit 53d132b

Please sign in to comment.