guoguo12 / messenger-shortcuts

Keyboard shortcuts for the Facebook Messenger web app (messenger.com).
https://chrome.google.com/webstore/detail/keyboard-shortcuts-for-me/elgfaolomlhhmppjdicpgpmglkllebfb?hl=en-US&gl=US
19 stars 9 forks source link

Use meta tags to get language code #28

Closed mmaterowski closed 2 years ago

mmaterowski commented 3 years ago

Hey. I didn't found out much, but lang property is no more available on documentElement, nor on body. I used meta tags and extension is now loaded, but stuff is still not working properly

Tested on : Brave Version 1.18.75 Chromium: 87.0.4280.101 (Official Build) (64-bit)

Additional hints:

guoguo12 commented 3 years ago

Thanks! document.documentElement.lang shows up fine for me. Do you think it's specific to Brave? Or to non-English languages?

mmaterowski commented 3 years ago

image Something's fishy here and I'm not quite sure what's the problem tbh. document.documentElement.lang is just a shortcut for accessing property that I can indeed see in html tag.

I guess You may use this method as a fallback, but I think it might be even better idea to check if there's any value before fetching .json and set it to en just in case, otherwise it will crash the extension 😢

I tested it both on chrome (87.0.4280.88 ) and brave and even if it finds the right language code it cannot fetch .json.

mmaterowski commented 3 years ago

Tested locally with updated master - looks good and there's no errors. I guess You may ignore the PR.

Although alt+up/down does not seem to work. Are You planning to add this feature to new version?

I may take a look at it if there are some problems, coz' it's the most crucial thing for me in this extension :D

guoguo12 commented 3 years ago

Ah, I'm not planning to add it. I couldn't figure out how to determine which chat is currently selected. Let me know if you make any progress!