ansh / jiffyreader.com

A Browser Extension for faster reading on ANY website!
https://www.jiffyreader.com/
GNU General Public License v3.0
3.73k stars 200 forks source link

fix: wrong prefs when using shortcut on page load. #118

Closed paxelpixel closed 2 years ago

paxelpixel commented 2 years ago

I noticed that when I use the shortcut key, it's not using my line height preference on page load. Turns out it was using the default preference because storage wasn't working correctly. the culprit is that await getPrefs() is just sending a message back to background script. and if it was called within the background script, if was effectively a background to background message, and both this and this says that's not allowed

solution: detect if its a bg script and get storage directly.

asieduernest12 commented 2 years ago

nice. I run into that issue trying to refactor contentscript getOrigin to use TabHelper and i left it as it was originally working