XKit-Rewritten icon indicating copy to clipboard operation
XKit-Rewritten copied to clipboard

Open in Tabs: New tabs may open in "blog view"

Open marcustyphoon opened this issue 3 years ago • 3 comments

Platform

MacOS 10.15.7 x86

Browser

Edge 105.0.1343.33

Addon version

v0.20.9

Details

Blog view URLs have been changed. Instead of /blog/view/blogname they’re now simply /blogname (e.g. tumblr.com/changes).

This will ~~probably~~ necessitate a change to this line in Open in Tabs:

https://github.com/AprilSylph/XKit-Rewritten/blob/cee9850ca027248c86f6298bff18717a32777a6c/src/scripts/open_in_tabs.js#L15

~~I don't know if this currently does anything.~~

Edit: Oh, clicking a notification is currently not redirected.

marcustyphoon avatar Sep 09 '22 19:09 marcustyphoon

I actually helped implement this new route format and it does suck for this. There's no way to tell from the outside if a link is to a blog or not just by the href. Redpop has a list of reserved names but it's not exposed and the long-term goal is to remove it anyway.

AprilSylph avatar Sep 09 '22 21:09 AprilSylph

Yeah, I was thinking of maybe just regexing tumblr.com/anyString/obviouslyAPostId and dropping support for direct links to blogs. Not familiar offhand with every place this code actually matters.

marcustyphoon avatar Sep 09 '22 22:09 marcustyphoon

Now hold on, I just realised because blog links are generally standardised, we could target [data-login-wall-blog-name] for most cases. Just checked and they are present on notifications.

Also, the regex for blog names off the top of my head is /[a-z0-9-]{1,32}/, if we do need it.

AprilSylph avatar Sep 09 '22 22:09 AprilSylph