Acidham / chromium-hist-bookmarks

Search in Chromium History and Bookmarks
137 stars 18 forks source link

Does not find any bookmarks in Brave (Dev) #22

Closed jpuris closed 2 years ago

jpuris commented 2 years ago

Heya!

The workflow seems to not be able to find any bookmarks, so I pocked around and in the workflows working dir run a test

./py3.sh chrom_bookmarks.py youtube

which throws following

mkdir: .: No such file or directory
DEBUG: Version: 3.89
DEBUG: Version: 3.106
make_alias:6: read-only file system: /py3
{
    "items": [
        {
            "title": "Config: Python3 was found at /usr/bin/python3.",
            "subtitle": "Version: 3.89, Proceed typing query or re-run worfklow",
        }
    ]
}
DEBUG: Python3 was found at /usr/bin/python3.
setup_python_alias:.:32: no such file or directory: /py3

with DEBUG=1

is this something on my end?

jpuris commented 2 years ago

I suspect running this from cli is not valid use case, since in the py3.sh the workding directory is passed in from alfred

WF_DATA_DIR=$alfred_workflow_data
...
#Cache file for python binary - Allowes for faster execution
PYALIAS="$WF_DATA_DIR/py3"

But then, I've got no clue how to troubleshoot the absence of any bookmarks :(

I'm trying to get this work with Brave (Dev) browser.

jpuris commented 2 years ago
CleanShot 2022-08-26 at 21 35 16@2x

No errors displayed in Alfred

Acidham commented 2 years ago

You cannot run sh and py from command line because workflow dir env variable will be set by Alfred.

when you run the WF what is written in the debugger ?

what you can try is to exchange ./py3.sh and run with /usr/bin/python3

jpuris commented 2 years ago

@Acidham running /usr/bin/python3 chrom_bookmarks.py youtube gets me

❯ /usr/bin/python3 chrom_bookmarks.py youtube
Traceback (most recent call last):
  File "chrom_bookmarks.py", line 26, in <module>
    show_favicon = Tools.getEnvBool("show_favicon")
  File "/Users/jp/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.70A42591-FADF-4DCD-ACE0-279A5A3EF993/Alfred3.py", line 271, in getEnvBool
    if os.getenv(var).isdigit():
AttributeError: 'NoneType' object has no attribute 'isdigit'

python version

❯ /usr/bin/python3 --version
Python 3.8.9
Acidham commented 2 years ago

argh ...I thought i fixed that one but seems not.

can you please ensure to configure in workflow config to show fav icons?

jpuris commented 2 years ago

Found the problem. The "Dev" should actually be "Beta".

From Alfred debugger

[21:46:03.623] Logging Started...
[21:46:07.651] Chromium Bookmarks and History Search[Script Filter] Queuing argument 'youtube'
[21:46:08.091] Chromium Bookmarks and History Search[Script Filter] Script with argv 'youtube' finished
[21:46:08.095] STDERR: Chromium Bookmarks and History Search[Script Filter] PYTHON VERSION: 3.8.9 (default, Apr 13 2022, 08:48:06) 
[Clang 13.1.6 (clang-1316.0.21.2.5)]
/Users/jp/Library/Application Support/BraveSoftware/Brave-Browser-Dev/Default/Bookmarks → NOT found
[21:46:08.096] Chromium Bookmarks and History Search[Script Filter] {
    "items": [
        {
            "title": "No Bookmark found!",
            "subtitle": "Search \"youtube\" in Google...",
            "arg": "https://www.google.com/search?q=youtube"
        }
    ]
}

When I first install the workflow, I did not see "Beta", hence chose "Dev"

CleanShot 2022-08-26 at 21 48 32@2x
❯ ls -l ~/Library/Application\ Support/BraveSoftware/
drwx------ jp staff 1.3 KB Fri Aug 26 21:48:06 2022  Brave-Browser-Beta
Acidham commented 2 years ago

yes never used beta. You can add URL in py file. you also need to change WF config to show properly in wF config.

I am on vacation without a computer otherwise I would change it.

jpuris commented 2 years ago

Thank you for the assist @Acidham and have a great holiday!