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

Add Profile support on Bookmarks for Edge browser #2101

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

dantesg
Copy link

@dantesg dantesg commented Apr 29, 2023

This allows user to open bookmarks taking into consideration which profile the bookmark is on.
I use Edge so it's well tested on it. I assume it should also work on Chrome. I don't use Firefox on a daily basis.

Here's what it looks like:
image

@github-actions

This comment was marked as resolved.

{
try
{
return c.Source.Split('(', ')')[1];
Copy link
Member

Choose a reason for hiding this comment

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

what does this split mean?

Copy link
Author

Choose a reason for hiding this comment

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

this is just a fancy way to extract the value between those chars

Copy link
Member

Choose a reason for hiding this comment

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

Oh I see, so you are getting the content between the parenthesis?

Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs Outdated Show resolved Hide resolved
@dantesg
Copy link
Author

dantesg commented May 12, 2023

@taooceros @VictoriousRaptor I've been using this since then and no issues at all

Copy link
Contributor

@VictoriousRaptor VictoriousRaptor left a comment

Choose a reason for hiding this comment

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

Please clarify when opening a bookmark from non-default browser set in Flow, on your current build. Haven't tested it yet but it looks like because API doesn't provide an option to specify browser so wrong profile args are sent to default browser.

~~ I've refactored the OpenUrl API for better future compatibility. ~~

On second thought we shouldn't touch API in this PR.

@github-actions

This comment has been minimized.

@github-actions
Copy link

@check-spelling-bot Report

🔴 Please review

See the 📂 files view or the 📜action log for details.

Unrecognized words (1)

Firefox

To accept ✔️ these unrecognized words as correct and remove the previously acknowledged and now absent words, run the following commands

... in a clone of the git@github.com:dantesg/Flow.Launcher.git repository
on the bookmark-profiles branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/main/apply.pl' |
perl - 'https://github.com/Flow-Launcher/Flow.Launcher/actions/runs/4961201103/attempts/1'
If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

@dantesg
Copy link
Author

dantesg commented May 12, 2023

Please clarify when opening a bookmark from non-default browser set in Flow, on your current build. Haven't tested it yet but it looks like because API doesn't provide an option to specify browser so wrong profile args are sent to default browser.

~~ I've refactored the OpenUrl API for better future compatibility. ~~

On second thought we shouldn't touch API in this PR.

@VictoriousRaptor You're correct. Haven't notice this before.
If user uses Chrome and Edge to bookmark and profiles it can run into the following situation.

  1. Edge default browser
  2. Chrome profile 11 bookmarks google.com
    3.1. Flow.Launcher launches google.com from Chrome bookmark -> on default browser -> Edge -> targeting profile 11 - It'll create profile 11 data folder and start Edge from there.
    3.2. If profile 11 already exists on Edge, it'll just use that data folder instead and launch Edge from there (which is not correct if you rely on sessions from Chrome).

It's not a scenario I would run into but it's worth considering. Perhaps in the future we could extend the bookmark plugin to also keep track of browser absolute path somehow but for now it only spawns the default browser as-is on current implementation.

Currently if I have a bookmark on Firefox and open it, it'll also open on default browser Edge, not Firefox.

Happy to close this PR as not suitable to everyone if you think the workflow above can/will be too confusing.

I want to hear your thoughts on this one before putting more work into this one.

@VictoriousRaptor
Copy link
Contributor

It's not a scenario I would run into but it's worth considering. Perhaps in the future we could extend the bookmark plugin to also keep track of browser absolute path somehow but for now it only spawns the default browser as-is on current implementation.

Currently if I have a bookmark on Firefox and open it, it'll also open on default browser Edge, not Firefox.

So this is what the default browser settings's about. API only provides the function to open a url in default browser.

A reasonable solution is to implement a browser selection feature in Bookmarks plugin to open the bookmark in the browser and profile as is.

@jjw24 jjw24 marked this pull request as draft November 19, 2023 04: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.

None yet

3 participants