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

Fix FastGPT disappearing on settings toggle #65

Merged
merged 1 commit into from
Jan 26, 2024

Conversation

BrunoBernardino
Copy link
Contributor

Also change the context summarization to open in the popup as the extension, instead of a new tab.

This will be released on 0.5.1.

Fixes #45
Fixes #64


kagi_chrome_0.5.1.zip
kagi_firefox_0.5.1.zip

Also change the context summarization to open in the popup as the extension, instead of a new tab.

This will be released on 0.5.1.

Fixes #45
Fixes #64
Comment on lines +213 to +224
async function kagiSummarize(info) {
// The linkUrl will be undefined if function is triggered by a page event. In that case, the url is taken from pageUrl
const url = info.linkUrl || info.pageUrl;
browser.tabs.create({
url: `https://kagi.com/summarizer/index.html?url=${encodeURIComponent(
url,
)}`,

await browser.windows.create({
url: browser.runtime.getURL(
`src/summarize_result.html?url=${encodeURIComponent(url)}`,
),
focused: true,
width: 600,
height: 500,
type: 'popup',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes fix opening up in the popup instead of a new tab with the summarizer (#45).

Comment on lines +276 to +280
fastGptSection.style.display = 'none';
} else {
summarizeSection.style.display = '';
requestPermissionsSection.style.display = 'none';
fastGptSection.style.display = '';
Copy link
Contributor Author

@BrunoBernardino BrunoBernardino Jan 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes fix FastGPT disappearing when toggling settings (#64).

@@ -89,11 +89,16 @@ async function setup() {

const searchParams = new URLSearchParams(window.location.search);

// If there's no URL, get the currently active tab and default params
if (!searchParams.get('url')) {
if (!searchParams.get('summary_type')) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in this file allow the popup to be initialized with just a URL param (right click context open), otherwise not all parameters would've been properly set.

@vprelovac vprelovac merged commit bc7637b into main Jan 26, 2024
1 check passed
@BrunoBernardino BrunoBernardino deleted the fix/fastgpt-and-context-popup branch January 26, 2024 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FastGPT vanishes when clicking on settings icon Right click summarize should open popup window
2 participants