-
Notifications
You must be signed in to change notification settings - Fork 21
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
Conversation
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', |
There was a problem hiding this comment.
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).
fastGptSection.style.display = 'none'; | ||
} else { | ||
summarizeSection.style.display = ''; | ||
requestPermissionsSection.style.display = 'none'; | ||
fastGptSection.style.display = ''; |
There was a problem hiding this comment.
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')) { |
There was a problem hiding this comment.
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.
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