PasteBar / PasteBarApp

PasteBar - Limitless, Free Clipboard Manager for Mac and Windows
Other
852 stars 29 forks source link

Feature Request: Allow ability to exclude certain apps when copying history #113

Closed alotia closed 3 months ago

alotia commented 3 months ago

Please provide an ability to exclude certain apps, such as password managers, when copying to the clipboard history.

kurdin commented 3 months ago

@alotia Thank you for your suggestion, but unfortunately, I don't have access to the OS and can't detect which app is used for the user's copy action. This would require a deeper integration into the users' OS (on Mac or Windows), and I don't want to do that. Privacy first.

You have two options with PasteBar. You can mask the password in the clipboard history.

image

Next time you copy your password, it will be masked.

image

Or add your password or password prefix to the Stop Words List in the Clipboard History Settings.

image

This should completely ignore adding your password to the clipboard history. Hope this help.

alotia commented 3 months ago

I appreciate the workarounds. Most of the passwords are "random" ones and second suggestion would mean putting the passwords in a "clear text" window, so that won't work, but I will try to use the first suggestion.

The rest of the app is nicely done, and I feel it will be much better if you are able to provide the deeper integration. I am not sure how that breaks privacy, but I am not a mac/win developer.

Thank you for the quick and detailed reply! Feel free to close this issue as appropriate.

kurdin commented 3 months ago

Most of the passwords are "random" ones and second suggestion would mean putting the passwords in a "clear text" window, so that won't work, but I will try to use the first suggestion.

Yeah, I understand this and I agree it would make a good feature to simply block some apps from detecting the copy action. Thank you again for your suggestions. Maybe other developers can help and suggest solutions on how to create such a detection mechanism, but right now I don't know how.

Anyone who can help, please feel free to reopen this issue and suggest changes or create a PR!

VeRychard commented 3 months ago

There are libraries for GetWindowThreadProcessId and GetForegroundWindow through ref-napi and ffi-napi for Windows. I don't know much about Macs, but I've found this link which works through AppleScript, might help

edit: can't reopen the issue, hope my comment won't escape your attention 🙏

kurdin commented 3 months ago

Found this: https://hellocode.co/blog/post/tracking-active-process-windows-rust so I'll investigate possibility to track an active app/window when user copies something to the clipboard.

@VeRychard Thank you 🙏

kurdin commented 3 months ago

Found this another lib: https://github.com/dimusic/active-win-pos-rs?tab=readme-ov-file and it works on Mac and Windows. Working on apps exclude list implementation.

kurdin commented 3 months ago

Found a way to retrieve and store information about the source of copied item in history and display this on hover.

Screenshot 2024-07-30 at 19 25 29

Now working on Add to ignore an app name from the clipboard history copy action.

image
VeRychard commented 3 months ago

looking good! and such quick 🥳

kurdin commented 3 months ago

I added a new option in clipboard history settings to exclude apps from capturing clipboard history. Unfortunately, if an app has a copy to clipboard action from the menubar, it can't be detected; the app window must be in focus or active in the foreground. Anyway, this feature is still useful in many cases.

If anyone wants to try this out, the branch is exclude-apps-copy-to-history

Screenshot 2024-08-02 at 17 56 23
VeRychard commented 3 months ago

What do you mean copy to clipboard from the menubar? Is this an iOS thing? I would think when you copy from somewhere it will be active / in foreground.

Anyways nice feature, an additional thing could be to filter by application in the list (now we can filter for video/emoji/etc, but since you would have a list of applications you copied from it could be filtered).

Will check it out 👌

kurdin commented 3 months ago

@VeRychard I was talking about this taskbar menu.

image

Menu bar is MacOs equivalent of taskbar on Windows. image

I just tested on Windows and it works fine and won't lose focus to another app on copy. So only copy item from menubar on MacOs would not capture the app name of actual window. Windows users should be good.

kurdin commented 3 months ago

I adding an App Filter in clipboard history, this would be useful to quickly find a history items based on copy sources.

image

VeRychard commented 3 months ago

@VeRychard I was talking about this taskbar menu.

image

Menu bar is MacOs equivalent of taskbar on Windows. image

I just tested on Windows and it works fine and won't lose focus to another app on copy. So only copy item from menubar on MacOs would not capture the app name of actual window. Windows users should be good.

Well I reckon people usually copy from right click context menu and/or Ctrl/Cmd + C (also PasteBar's taskbar icon doesn't have copy to clipboard as I saw), so I don't think that will be an issue :)

kurdin commented 3 months ago

Merged #121 New Release with Excluded Apps List https://github.com/PasteBar/PasteBarApp/releases/tag/v0.5.5