meetDeveloper / Dictionary-Anywhere

Dictionary extension that helps you stay focused on what you are reading by eliminating the need to search for meaning.
GNU General Public License v3.0
253 stars 53 forks source link

fix: add UA to get a parsable result on android #69

Closed igorlogius closed 1 year ago

igorlogius commented 1 year ago

The googles translation endpoint seems to reply with different data depending on the UserAgent which the fetch requests sends out. On Android devices this causes all Requests to be unparsable by the followup process and causes the Sorry. No definition found. message to always be show.

By simply setting the UA to a fixed string meant for a Desktop version, everything should work as expected.

Future Improvement: might be a good idea to somehow get the latest firefox desktop version from ftp.mozilla.org or somewhere else and use that to to dynamically build the UA string.