benjypng / chrome-extension-logseq-quickcapture Goto Github PK
View Code? Open in Web Editor NEWchrome-extension-logseq-quickcapture
License: MIT License
chrome-extension-logseq-quickcapture
License: MIT License
I was very happy when I discovered the "Logseq Quick Capture" plugin, which can directly extract text from web pages.
Is it possible to remove the "time stamp" and the "[[quick capture]]:" mark to make the excerpt text more pure. Even, we can change the format we want . for example, adding quotation marks around the text, like this "This is an excerpt".
Extension looks great. Any plans for a Firefox WebExtension build?
Currently when using the extension it uses a format that isn't optimal to me in a couple of ways:
[[quick capture]]
tag, I already have it configured to go into my #Bookmarks
page, so that's the only page reference I need.Instead I would like to use this simple format:
Title of the page - [link](https://actual.url/path)
Is there any chance you could add another textfield to the settings that lets us customize the format and insert the following 3 variables for now:
So in my example I'd set the textfield to {title} - [link]({url})
.
The current default for users out there would be this format I guess: **{time}** [[quick capture]]: [{title}]({url})
Thanks for considering! It would really go a long way for a clean bookmark list. If you don't have time to implement this let me know and I can see what I can do, but also don't have a lot of time at the moment.
Update: I did look at this closed issue where it's suggested that custom capture template for quick capture can be configured in Logseq. So I went an edited my config.cdn
and added the following:
:quick-capture-templates
{:text "{text} - [link]({url})"
:media "{url}"}
When when I try this, for example for this page here it inserts the following into Logseq:
- [link](Ability to customize link format being captured ยท Issue )
I thought maybe that's an issue because of the #
sign in the title (#9). So I tried another page, e.g. https://google.com and for that it inserts:
- [link]([Google](https://www.google.com/))
๐ด So it seems like it's not properly splitting up the capture into text
and url
and just puts everything into url
and text
is blank? Anything that can be done about that? And also any way by chance the #
symbol in the title breaking the link can be fixed? Thanks!
My understanding is that the callback url should look like this for Google for example:
logseq://x-callback-url/quickCapture?url=https://google.com/&title=Google
Right now it looks like both are crammed into url
and title
is not being passed in properly. Is that something you would adjust?
Version 0.2.5
null
.**14:43** [[quick capture]]: null [Youtube Video RAG Search - crewAI](https://docs.crewai.com/tools/YoutubeVideoSearchTool/)
Ifresult
is null, don't include it in the content
URL parameter.
The chrome web store shows version 0.2.3 while the manifest shows 0.2.2.
Hello, great extension!
Feels really nice to be able to easily send text and maintain context quickly from your browser.
I'd be interested in also preserving more of the selected content, links, formatting etc.
We can extract the html tags for the given selection by changing the method of retrieving text from using window.getSelection().toString()
to using:
let html = window.getSelection().getRangeAt(0).extractContents();
If we make sure all links are absolute:
// Convert paths like /wiki/ to https://en.wikipedia.org/wiki/ and #anchor-location to https://en.wikipedia.org/wiki/SomePage#anchor-location
html.querySelectorAll("a").forEach((a) => {
a.href = new URL(a, document.baseURI).href;
});
We can run the html through an HTML to Markdown formatter like turndown and preserve links:
I made a quick version of it locally, but just copy pasted all of turndown.js
into the chrome.scripting.executeScript
call as a test.
You click on the extension, logseq loads, but nothing is added. If you watch carefully, the URL includes undefined
.
Additional testing shows that the page
, append
, title
, and content
fields of the URL are all undefined
.
The code is trying to use these values before their respective promises resolve (creating a race condition).
(incorrect code)
(async () => {
const [tab] = await chrome.tabs.query({
active: true,
lastFocusedWindow: true,
});
This does not automatically turn chrome.tabs.query
synchronous. It returns a promise that still has to be resolved.
Package the top-level code into an async function then resolve the promise appropriately.
Example:
async function getCurrentTab() {
let [tab] = await chrome.tabs.query({
active: true,
lastFocusedWindow: true,
});
return tab;
}
getCurrentTab().then(tab => {
// now it's defined
});
The same problem affected reading the options with chrome.storage.sync.get
-- they were undefined
due to a race condition and also needed default values.
PR coming momentarily.
I have two Google accounts: an old personal gmail and a new Google Workspace for my work. The extension saves content to Logseq when used from the standalone Gmail, but not from the Google Workspace account.
I'm the admin on the work account, and there are no restrictions on apps or extensions.
I would love to be able to customize the text that goes into Logseq when a quick capture happens so that it better suits the way I use Logseq.
To expand on this, I would like to be able to have different templates depending on the website I'm on. Examples:
#[[Watch]]
reference.#[[Shopping]]
reference.I'm not sure if this is a problem with the extension, or the API being used by the extension.
Steps to recreate:
Expected:
Page to be entered into Logseq with the full title and URL linked:
**12:16** [[quick capture]]: [Railway Oriented Programming | F# for fun and profit](https://fsharpforfunandprofit.com/rop/)
Actual:
**12:16** [[quick capture]]: Railway Oriented Programming | F
text including and after the #
is cut-off.
Hi there... I like very much this extension, very useful.
I was wondering if is it possible to let the hashtag (#) and/or the square brackets ([[]]) do their job in the selected text.
This is because I would like to add this to my gmail, for example,Dear [[Mr Bruce Wang]] I have this [[LogSEQ Project]] and ...
so, I send the email and before it get lost in my Sent Emails, well, I use your extension to add the selected text to logseq and Mr Bruce Wang
and LogSEQ Prject
will become a nodes.
What do you think??
Sometimes, I want to push a link to the cursor location and sometimes I want to send to the end of today's journal page.
I have the default set to Append Today and generally push with a keyboard shortcut (i.e., CMD+SHIFT+L). For times when I want to send the link to the cursor location instead, it would be awesome if I could use a secondary keyboard shortcut (CTRL+SHIFT+L)
This would save a few edits/seconds when I'm in a page -- where, I currently have to flip from the page I'm on to the Journal, cut the link, go back to the page and paste it manually.
Hello developer. Do you have any plans for this Extension in the future? Will there be more features?
On my mac using the Edge browser, the quick capture extension (with the send to option set to 'today'), it sends links to a page called "undefined".
If I change it to 'cursor', it sends it to a page called "cursor" instead of the actual cursor position at the current page.
On a win11 box running the Edge browser, the send to location works as expected. So, I believe it's a mac issue.
Running Mac OS Ventura 13.1 and logseq 0.8.14, but issue was occurring on the last MacOS and logseq builds as well.
Chrome Version 110.0.5481.177 on MacOS 13.2.1 , plugin version 0.2.1
capture to TODAY works fine, as does capturing to a specific page.
capture to CURSOR flashes logsync and then does not enter text.
Also tried to disable all other plugins to avoid problems caused by that.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.