anka-213 / webcomic_reader

Webcomic Reader userscript at
https://openuserjs.org/scripts/anka-213/Webcomic_Reader
MIT License
120 stars 27 forks source link

Can’t navigate forward/back on www.egscomics.com subdomain of El Goonish Shive #133

Closed roryokane closed 5 years ago

roryokane commented 5 years ago

If you visit the root http://www.egscomics.com/ or a specific comic such as http://www.egscomics.com/comic/tlod-001, then the previous and next image never finish loading, so Back and Next don’t work.

In contrast, if you visit http://egscomics.com/ (without the “www.” subdomain) or a specific comic such as http://egscomics.com/comic/tlod-001, then Back/Next work as expected. Thus, one workaround is to manually remove “www.” from the URL whenever you find yourself visiting a “www.” page on the site.

The current code for this site:

https://github.com/anka-213/webcomic_reader/blob/cf2b43d2a059a7f547ac1e78fb4bda08e42a31f2/webcomic_reader.user.js#L134-L135

https://github.com/anka-213/webcomic_reader/blob/cf2b43d2a059a7f547ac1e78fb4bda08e42a31f2/webcomic_reader.user.js#L4147-L4155

All links on www.egscomics.com pages use a URL starting with http://egscomics.com – this may be related to the issue.

Because of that property of links on the site, you will notice while testing that if you disable the script, click any link, and enable the script, then page navigation will work again.

The HTML of the pages at http://www.egscomics.com/ and http://egscomics.com/ are identical. The only difference between those pages is the URL, and possibly other headers.

I blindly tried changing the url property in the code to 'www.egscomics.com', changing url to /(www\.)?egscomics.com/, commenting out the extra property, and commenting out the img property, but none of those changes made navigation work on “www.” pages.

SoraHjort commented 5 years ago

This got fixed in my pull last night. Didn't even see this issue till now though. It required the use of the fixurl.

edit: spoke too soon, the fix broke the non-www. Looking into it

Edit 2: Alright, fixed for sure this time. Needed two seperate entries in paginas. One to handle the fixurl for the www, and the other for non-www.