Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
32 changes: 21 additions & 11 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,38 @@
"name": "Dino",
"version": "1.0",
"description": "A chrome extension to help people with dyslexia and color blindness access web pages with more ease.",
"icons": {

"icons": {
"16": "assets/images/dino_16px.png",
"48": "assets/images/dino_48px.png",
"128": "assets/images/dino_128px.png"
"128": "assets/images/dino_128px.png"
},

"action": {
"default_popup": "popup.html"
"default_popup": "popup/index.html"
},
"web_accessible_resources": [

"content_scripts": [
{
"matches": ["<all_urls>"],
"resources": ["assets/*"]
"all_frames": true,
"js": ["content.js"],
"css": ["webpage-assets/css/styles.css"]
}
],
"content_scripts": [

"web_accessible_resources": [
{
"matches": ["*://*/*"],
"all_frames": true,
"js": ["webpage-assets/js/content.js", "mark.js"],
"css": ["webpage-assets/css/styles.css"]
"matches": ["<all_urls>"],
"resources": [
"mark.js",
"webpage-assets/css/styles.css",
"webpage-assets/fonts/*",
"assets/*"
]
}
],
"permissions": ["tabs", "activeTab"],

"permissions": ["activeTab", "tabs"],
"host_permissions": ["http://*/*", "https://*/*"]
}
47 changes: 47 additions & 0 deletions popup/common.js
Original file line number Diff line number Diff line change
@@ -1 +1,48 @@
const app = document.getElementById("app");

async function loadPage(page) {
const res = await fetch(`pages/${page}.html`);
const html = await res.text();
app.innerHTML = html;
bindPageEvents(page);
}

function bindPageEvents(page) {
if (page === "visuals") {
document.getElementById("toggleTheme")?.addEventListener("click", () => {
chrome.tabs.query({ active: true, currentWindow: true }, tabs => {
chrome.tabs.sendMessage(tabs[0].id, { action: "toggleTheme" });
});
});

document.getElementById("highlightText")?.addEventListener("click", () => {
chrome.tabs.sendMessage(
chrome.tabs.query({ active: true, currentWindow: true }),
{ action: "highlight" }
);
});
}

if (page === "speech") {
document.getElementById("readPage")?.addEventListener("click", () => {
chrome.tabs.sendMessage(
chrome.tabs.query({ active: true, currentWindow: true }),
{ action: "read" }
);
});
}

if (page === "translator") {
window.location.href = "../Translator/index.html";
}
}

// Navigation buttons
document.querySelectorAll("nav button").forEach(btn => {
btn.addEventListener("click", () => loadPage(btn.dataset.page));
});

// Load default page
loadPage("home");

let Preference = {};
21 changes: 21 additions & 0 deletions popup/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Dino</title>
<link rel="stylesheet" href="../css/styles.css">
</head>
<body>

<nav class="nav">
<button data-page="home">Home</button>
<button data-page="visuals">Visual</button>
<button data-page="speech">Speech</button>
<button data-page="translator">Translate</button>
</nav>

<main id="app"></main>

<script src="common.js"></script>
</body>
</html>
2 changes: 2 additions & 0 deletions popup/pages/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h2>Welcome to Dino 🦖</h2>
<p>Select a tool from above.</p>
2 changes: 2 additions & 0 deletions popup/pages/speech.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h2>Speech Tools</h2>
<button id="readPage">Read Page Aloud</button>
3 changes: 3 additions & 0 deletions popup/pages/visuals.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<h2>Visual Tools</h2>
<button id="toggleTheme">Toggle Theme</button>
<button id="highlightText">Highlight Text</button>