Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added open popup #78

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
13 changes: 7 additions & 6 deletions extension/public/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ chrome.runtime.onInstalled.addListener(() => {
await chrome.tabs.sendMessage(tab.id, {
selectedText: info.selectionText
});

// Open the popup
// Note: Chrome extensions can't programmatically open the popup,
// but we can show the user where to click

// Set popup
chrome.action.setPopup({
popup: "src/popup/popup.html"
popup: "src/pages/home/home.html"
});

// Open popup
chrome.action.openPopup();

// Show a badge to indicate text was captured
chrome.action.setBadgeText({
Expand Down Expand Up @@ -97,4 +98,4 @@ chrome.storage.onChanged.addListener((changes, namespace) => {
} else if (details.reason === "update") {
console.log("Extension updated");
}
});
});