This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"action": { | |
"default_title": "Chrome History Dashboard", | |
"default_popup": "./index.html", | |
"default_icon": { | |
"16": "images/icon16.png", // optional | |
"24": "images/icon24.png", // optional | |
"32": "images/icon32.png" // optional | |
}, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const History: React.FC<HistoryProps> = ({ items }) => { | |
return ( | |
<StyledList> | |
{items.map((item) => ( | |
<HistoryItem key={item.id} item={item} /> | |
))} | |
</StyledList> | |
); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const StyledList = styled.ul` | |
list-style: none; | |
padding: 0; | |
margin: 0; | |
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { useChromeHistorySearch } from "../hooks/useChromeHistorySearch"; | |
import { History } from "./History"; | |
interface DashboardProps {} | |
const query = { text: "", maxResults: 100 }; | |
export const Dashboard: React.FC<DashboardProps> = () => { | |
const mostRecentItems = useChromeHistorySearch(query); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
interface HistoryItemProps { | |
item: chrome.history.HistoryItem; | |
} | |
export const HistoryItem: React.FC<HistoryItemProps> = ({ item }) => { | |
return ( | |
<li> | |
<span>{new Date(item.lastVisitTime ?? 0).toLocaleTimeString()}</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { HistoryItem } from "./HistoryItem"; | |
import { StyledList } from "./History.styled"; | |
const MemoizedHistoryItem = React.memo(HistoryItem); | |
interface HistoryProps { | |
items: chrome.history.HistoryItem[]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import ReactDOM from "react-dom/client"; | |
import App from "./App"; | |
const rootElement = document.createElement("div"); | |
rootElement.id = "chrome-history-dashboard"; | |
document.body.appendChild(rootElement); | |
const root = ReactDOM.createRoot(rootElement); | |
root.render( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Chrome History Dashboard</title> | |
<style> | |
body { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "chrome-history-extension", | |
"description": "Chrome extension that accesses the chrome history API to read the browser history and display it in our own personalized React dashboard", | |
"version": "1.0.0", | |
"manifest_version": 3, | |
"action": { | |
"default_title": "Chrome History Dashboard", | |
"default_popup": "./index.html" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Chrome History Extension", | |
"version": "1.0.0", | |
"manifest_version": 3 | |
} |