Mangadex not working properly as a search engine in Firefox

Group Leader
Joined
Jan 19, 2018
Messages
205
TL;DR: Mangadex cannot understand something like
Code:
https://mangadex.org/quick_search/One+Piece
as a valid search because of the + sign.

So I always have a habit of creating custom search engines for websites I use frequently and Mangadex is no exception, however I've run into an issue on Firefox that completely breaks the search function on this site.
Note: I'm aware Firefox doesn't natively support adding custom search engines but it is still possible to add them via add-ons like this one which is what I and many others do and they work fine, so this issue isn't related to how the search engine is being created, but rather how Firefox itself creates a search query.

Firefox always converts spaces in search queries to + symbols, so whenever I search something on mangadex via my URL bar that has a space in it that space turns into a + sign.
Example: if I search
Code:
One Piece
it'll turn into
Code:
One+Piece

Unfortunately mangadex doesn't handle this type of query properly and assumes the + is part of the title, meaning if I search for something like "One Piece" using this method it will tell me it didn't find anything because it's reading my search query literally as "One+Piece"

This is not an issue in Chrome because spaces in search queries get turned into %20 instead and mangadex does parse that correctly, but it'd be great if you could add custom engine support for people who use Firefox, even if they're not the majority, because as it stands Mangadex cannot be used as a search engine in Firefox and that's a big bummer.

If there is already an existing workaround for this problem I'd be all ears.

Thank you for reading.
 
Fed-Kun's army
Joined
Jan 20, 2018
Messages
1,692
Not a geek but, is it impossible to just have the add on interprets space as %20 rather than +?
 
Group Leader
Joined
Jan 19, 2018
Messages
205
@421cookies

It's not the add-on that does this, it's firefox itself. There is nothing anyone can do to change that behavior.
The add-on merely creates a search profile firefox can save. Unlike Chrome, Firefox does not have a native functionality to add custom search urls, that's why an add-on like that is needed, but that's all the add-on does, give firefox a url with a %s attribute it can replace with the search query. Nothing more. It's the exact same thing you can do natively in Chrome, the difference is that Chrome converts spaces in search queries into %20 and Firefox converts them into + signs.

No matter what search engine it is (even the ones that come pre-built into Firefox) Firefox will always add a + when there is a space in any search query, it's how the browser was programmed to handle it.

But most sites actually interpret that + in the URL as a space just fine, I've only ran into this issue with Mangadex, hence I've made this post since I believe it can be fixed.
 
Joined
Apr 23, 2018
Messages
1,071
Wouldn't hurt to follow the standard here IMO. I don't think many will do this, but following an established standard is probably good idea anyways.

@Nosebleed That said, although Quick Search seems to not understand the normal format, Other Mangadex search methods may work!

For instance, both of these addresses search for what most of our users here want in their life.
https://mangadex.org/?page=search&title=a girlfriend
https://mangadex.org/?page=search&title=a+girlfriend

Considering the discrepancy between these two search features, I expect quicksearch to eventually be standardized and fixed. However, you may want to experiment with the other non-quick(normal) search features for the time being.

To help you get started, the search page used above has the following keywords:
Code:
[b]title=STRING[/b] -- Fuzzy search. Words separated by space (%20) or plus signs (+). Each word in string must be individually contained in the title. "k+k+k+k+k+k" Searches for any title containing at least one "k".
[b]author=STRING[/b] -- Author must contain string. Words separated by space (%20) or plus signs (+). "ni+ko" will match "Nani Kore" but not "Niko" nor "Nito Koto"
[b]artist=STRING[/b] -- Artist must contain string. Words separated by space (%20) or plus signs (+). "ni+ko" will match "Nani Kore" but not "Niko" nor "Nito Koto"
[b]tags_exc=TAG_ID[/b] -- List of tags to exclude/block. Tags separated by comma (,).
[b]tags_inc=TAG_ID[/b] -- List of tags to include/require. Tags separated by comma (,).
[b]lang_id=LANGUAGE_ID[/b] -- Original language
[b]demo_id=DEMOGRAPHIC_ID[/b] -- Target audience
[b]p=NUMBER[/b] -- Page number of the search. Index starts at 1.
[b]s=SORT_ID[/b] -- Sort method to use.


LANGUAGE_ID -- Listed in the order mangadex presents them.
Code:
0 = All languages
2 = Japanese
1 = English
3 = Polish
8 = German
10 = French
12 = Vietnamese
21 = Chinese
27 = Indonesian
28 = Korean
29 = Spanish (LATAM)
32 = Thai
34 = Filipino

DEMOGRAPHIC_ID
Code:
0 = All demographics
1 = Shounen
2 = Shoujo
3 = Seinen
4 = Josei

TAG_ID
Code:
[b]Content[/b]
9 = Ecchi
11 = Gender Bender
49 = Gore
50 = Sexual Violence
32 = Smut
[b]Format[/b]
1 = 4-Koma
42 = Adaption
43 = Anthology
4 = Award Winning
7 = Doujinshi
48 = Fan Colored
45 = Full Color
36 = Long Strip
47 = Official Colored
21 = Oneshot
46 = User Created
44 = Web Comic
[b]Genre[/b]
2 = Action
3 = Adventure
5 = Comedy
51 = Crime
8 = Drama
10 = Fantasy
13 = Historical
14 = Horror
41 = Isekai
52 = Magical Girls
17 = Mecha
18 = Medical
20 = Mystery
53 = Philosophical
22 = Psychological
23 = Romance
25 = Sci-Fi
28 = Shoujo Ai
30 = Shounen Ai
31 = Slice of Life
33 = Sports
54 = Superhero
55 = Thriller
35 = Tragedy
56 = Wuxia
37 = Yaoi
38 = Yuri
[b]Theme[/b]
57 = Aliens
58 = Animals
6 = Cooking
59 = Crossdressing
61 = Delinquents
60 = Demons
62 = Genderswap
63 = Ghosts
12 = Harem
83 = Incest
65 = Loli
66 = Magic
16 = Martial Arts
67 = Military
64 = Monster Girls
68 = Monsters
19 = Music
69 = Ninja
70 = Office Workers
71 = Police
72 = Post-Apocalyptic
73 = Reincarnation
74 = Reverse Harem
75 = Samurai
24 = School Life
76 = Shota
34 = Supernatural
77 = Survival
78 = Time Travel
80 = Traditional Games
79 = Vampires
40 = Video Games
81 = Virtual Reality
82 = Zombies

SORT_ID
Code:
0 = Most recently updated first
1 = Least recently updated first
2 = Alphabetical Order by Title
3 = Reversed Alphabetical Order by Title
4 = Least Comments first
5 = Most comments first
6 = Lowest Rating first
7 = Highest Rating first
8 = Least Views first
8 = Most Views first
10 = Least Follows first
11 = Most Follows first

Here is an example search looking for something that has "Hy" and "mi" in the Title by an author with "ma ma" in their name, an artist with "i H" in their name, a Tag of "Yuri" but NOT "Yaoi", and was originally written in the "Japanese" Language with a target Demographic of "Shoujo"!

https://mangadex.org/?page=search&title=Hy+mi&author=ma+ma&artist=i+h&tags_inc=38&tags_exc=37&lang_id=2&demo_id=2
No, I did not and do not plan on reading that. It is just the first title that satisfied the tag, demographic, and search language requirement that had a space in the author/artist names.

Another example. Search mangadex titles without yaoi nor Shounen Ai (notice the comma)!
https://mangadex.org/?page=search&tags_exc=37,30&title=<YOUR SEARCH TERMS GO HERE>

Remember, the search feature is subject to change. If your search stops working one day, @rdn or another Mangadex developer may have changed how search works.

Updated to new search format. Remember, it is still subject to change.
 
Group Leader
Joined
Jan 19, 2018
Messages
205
@firefish5000 ah it does seem to work correctly with the advanced search url, thanks for pointing that out. I'll have to use that as a solution for now.

I do like the advanced search, don't get me wrong, but 99% of the time I am search using my URL bar I'm just quickly looking up a title of a manga, so I don't need all the extra bits on the screen, hence I was trying to use the quick search url instead since it suits that purpose a lot better.

Of course I still hope the quick search one can be fixed to behave like the advanced search one, so this thread still stands for that.
 

Users who are viewing this thread

Top