Rayquaza01 / note-taker

A Firefox addon that adds a text box to a toolbar button for taking notes.
MIT License
28 stars 4 forks source link

Help/Request: More granular control over URL matching #12

Open seascape opened 6 years ago

seascape commented 6 years ago

Hey there. Just discovered this add-on today and it's almost perfect for my needs. Thank you for developing it so far.

One issue I've run into is that my use case involves lots of per-URL notes, and Note Taker (at least with default configuration) does not seem to differentiate URLs past the folder level.

For example, on Pixiv.net (a popular art site) it conflates any artist's illustration page with every other one on the site due to the format of their URLs:

https://www.pixiv.net/member_illust.php?id=16434980&type=illust https://www.pixiv.net/member_illust.php?id=13974815&type=illust

So effectively I cannot leave notes on a specific artist's galleries.

I am curious if the URL Parameters In Site Notes setting could make the URL detection more granular, but the Wiki's documentation doesn't explain what it does:


screenclip 14

Is this the setting I'm looking for to fix Pixiv and similar sites, or is this a use case not yet supported by Note Taker?

Thanks again!

Rayquaza01 commented 6 years ago

That's the right setting, just add id to the end of it.

The documentation is not very well written towards the bottom of the options, I'll need to rewrite some of them. Here's basically how it works:

Everything after the ? is a parameter, and they appear on notes based on that option. For example, https://www.pixiv.net/member_illust.php?id=16434980&type=illust has two parameters: id and type. Both are filtered from the note by default because the only parameters allowed are q and v. Adding id to the option allows it to appear in the note.

Parameters are on a whitelist basis because sometimes parameters are not needed (utm_* parameters) or make things behave strangely. https://www.youtube.com/watch?v=dQw4w9WgXcQ&t=120s (a video starting at 120 seconds) would give a different note than https://www.youtube.com/watch?v=dQw4w9WgXcQ (the same video) if all parameters were allowed by default, which might not be expected.

Let me know if you have any other problems!

seascape commented 6 years ago

Aha, thanks for explaining!

seascape commented 5 years ago

Hey there! Has this broken? On several sites that use ? followed by parameters I've noticed Note Taker has reverted(?) to considering only the pre-? URL.

https://gelbooru.com/index.php?page=post&s=list&tags=mumyuu https://gelbooru.com/index.php?page=post&s=list&tags=kusakabe_%28kusakabeworks%29

For example, I made a test note on the first gallery above, and it also appears in the second. It reports the note-tagged page as only https://gelbooru.com/index.php. However, URL Parameters in Site Notes is set to "q v id", so is this incorrect behavior?

screenshot: note taker

I noticed this on another site too, but didn't make note of which. Will be watching more closely. Edit: Ah, one case is trying to make a note for https://archive.org/search.php?query=CVG+magazine, Note Taker only records before the ?. In this case perhaps the "query=" needs whitelisted? Edit 2: Ah, adding "query" to the URL Parameters setting seems to let the notes recognize the query here. (You are seeing me learn how to us this in real time.) Edit 3: Adding "tags" to URL Parameters seems to work, too. Perhaps I just never noticed that my notes on tag-based sites weren't sticking the specific URLs? Hmm.

Anyway I assume I have this sorted now. I had thought that URL Parameters was for a limited selection of built-in magic values, but I see I can seemingly specify whatever I need there now. Cool!

Rayquaza01 commented 5 years ago

Sorry I didn't reply to this sooner. Though, I can see from your edits that you figured it out, so I'm glad it's working for you!