Giter Site home page Giter Site logo

chrome-extension-logseq-quickcapture's Introduction

My GitHub stats

chrome-extension-logseq-quickcapture's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

chrome-extension-logseq-quickcapture's Issues

Formatting custom excerpt text

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".
Attachment-1

Ability to customize link format being captured

Currently when using the extension it uses a format that isn't optimal to me in a couple of ways:

  1. It appends a timestamp that I don't want.
  2. I would also prefer to not have the whole title of the page be part of the link.
  3. Additionally I don't need to use the [[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:

  • time
  • title
  • url

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?

More features

Hello developer. Do you have any plans for this Extension in the future? Will there be more features?

"cursor" plus "append"=true does not work.

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.

Adding Hashtags and/or square brackets

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??

Fails to save pages that have a `#` character in the page's title

I'm not sure if this is a problem with the extension, or the API being used by the extension.

Steps to recreate:

  1. Go to https://fsharpforfunandprofit.com/rop/
  2. Click on Logseq Quick Capture

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.

Feature Request: add separate keyboard shortcut options for sending to today or cursor

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.

Extension sends link to "undefined" page on Mac

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".
Screenshot 2022-12-22 at 3 56 16 PM

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.

URL-only captures include `null` before URL

Version 0.2.5

To reproduce

  1. Open a web page
  2. Do not make a text selection
  3. Click the capture extension
  4. Observe the newly-added null.
**14:43** [[quick capture]]: null [Youtube Video RAG Search - crewAI](https://docs.crewai.com/tools/YoutubeVideoSearchTool/)

Cause

Ifresult is null, don't include it in the content URL parameter.

Firefox version

Extension looks great. Any plans for a Firefox WebExtension build?

Extension fails to save info under managed Google profile

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.

Tests (so far)

  1. When both Google profiles are open, the extension only works with the personal email.
  2. When logged out from the personal profile (only corp open), the extension still fails.
  3. Could it be Logseq pinning to a profile?
  • When both Google profiles are open, Logseq will open links in the older one (first in the profile list).
  • When logged out from the personal profile, Logseq will open links in the corp profile.
  1. Do other extensions work? Yes: the Zotero connector works across both profiles.

I'm the admin on the work account, and there are no restrictions on apps or extensions.

Preserve links and formatting

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:
image

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.

Extension fails to capture a URL from managed profiles due to a race condition

The Symptom

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.

Root cause

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.

The fix

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.

Custom template for capture

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:

  • When I quick-capture a Youtube page I would like to add a #[[Watch]] reference.
  • When I quick-capture an Amazon page I would like to add a #[[Shopping]] reference.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.