Skip to content

Omnibox keyword search fix, DIY sidePanel, and PowerShell build script #90

Closed
vaimalaviya1233 wants to merge 3 commits intolinkwarden:devfrom
vaimalaviya1233:dev
Closed

Omnibox keyword search fix, DIY sidePanel, and PowerShell build script #90
vaimalaviya1233 wants to merge 3 commits intolinkwarden:devfrom
vaimalaviya1233:dev

Conversation

@vaimalaviya1233
Copy link

Additions

  1. PowerShell build script (sorry i got no Linux pc and WSL is difficult with docker running in background)

Modifications

  1. DIY side panel page references back to extension popup

Fixes

  1. omnibox keyword search fix (from linkding-extension)

TODO

  • make new page for side panel which makes use of chrome api to refreshes the page using onUpdated and on tabchange (issue side panel doesn't auto refresh although the I implemented the function to reload but reload api doesn't reload the page possibly issue with chromium api that doesn't allow to update page)
  • add bookmark all page to collection (not implemented)

Signed-off-by: VaiMalaviya <55515799+vaimalaviya1233@users.noreply.github.com>
Signed-off-by: VaiMalaviya <55515799+vaimalaviya1233@users.noreply.github.com>
Signed-off-by: VaiMalaviya <55515799+vaimalaviya1233@users.noreply.github.com>
Copy link
Author

Choose a reason for hiding this comment

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

sorry, I can't run sh script on windows that's why i added

},
"omnibox": {
"keyword": "lk"
"keyword": "lw"
Copy link
Author

Choose a reason for hiding this comment

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

should be "lw" considering it is linkwarden and not linkding

import OnInputEnteredDisposition = chrome.omnibox.OnInputEnteredDisposition;

const browser = getBrowser();
let configuration = null; // this js needs init function which initializes the configuration variable thus solving many lines in this file which repeadiatly uses getConfig() it might be better
Copy link
Author

@vaimalaviya1233 vaimalaviya1233 Dec 10, 2024

Choose a reason for hiding this comment

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

i come from the java/kotlin/python so I don't know more of vite/javascript/typescript but this variable needs to be initialized in init function which should be added to this file which also reduces the getConfig() function code.

const url = isUrl
? content
: `lk`;
: `${configuration.baseUrl}/search?q=${encodeURIComponent(content)}`; // This part was taken https://github.com/sissbruecker/linkding-extension/blob/master/src/background.js
Copy link
Author

Choose a reason for hiding this comment

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

code from linkding

} catch (error) {
console.error("Failed to reload the side panel:", error);
}
}); No newline at end of file
Copy link
Author

@vaimalaviya1233 vaimalaviya1233 Dec 10, 2024

Choose a reason for hiding this comment

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

ummmm.... i inspected through the background.js console it does execute (see attached image) but chrome.sidePanel.setOptions() function doesn't reload the tab if it's already set to that for that we need to separate the sidepanel page and still i don't know vite so but i'll try to learn vite and implement it via chrome.runtime.onMessage.addListener() which should be able to execute the reload code window.location.reload();
📝:- also you might want to block comment out the both listener functions since they do nothing it was for debug.

image

@vaimalaviya1233
Copy link
Author

@crkos thanks for informing to change to dev branch, i tried to add the comments where it was necessary other than that code is ready to test. :)

  • also, I initially wanted to make the separate page for the sidebar but will do that pr to dev branch, but it will take a while since I'm beginner in using vite framework with no xp lol.

@daniel31x13 daniel31x13 deleted the branch linkwarden:dev January 3, 2025 15:55
@daniel31x13 daniel31x13 closed this Jan 3, 2025
@daniel31x13
Copy link
Member

Had to recreate the dev branch due to merge conflicts and this one got closed by itself right after.
Please create a new pr sorry...

@vaimalaviya1233
Copy link
Author

Had to recreate the dev branch due to merge conflicts and this one got closed by itself right after. Please create a new pr sorry...

ok no problem created draft pr #102

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.

2 participants