-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added ability to remember previous search, and highlight search field… #43
Conversation
I've made a simplified version of
Note: This won't work as is. You would need to implement this into our current codebase. |
Do you think we should be storing the previous search in the cloud rather than local storage? I've been thinking about it, and I think storing it locally would be a better option, and here is my reasoning: If I had the extension installed on multiple computers (maybe one of which was a work pc) and happened to be signed into Chrome on both, it makes sense to keep the search history separate because keeping the previous query for your work on your work machine would be more useful. If at home I were to look for, say, a name to find posts by a person in a Facebook feed, it wouldn't be useful to keep that at work. What do you think? |
@brandon1024 Yea sounds good. pretty sure its as simple as changing chrome.storage.sync to chrome.storage.local |
I think so too, pretty sure its just a matter of changing |
edaecb8
to
1090e2c
Compare
1090e2c
to
aa0d030
Compare
Testing now 🔃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once this is fixed, will merge :)
popup/popup.js
Outdated
@@ -1,7 +1,7 @@ | |||
|
|||
window.onload = function() { | |||
document.getElementById('closeBtn').onclick = closeExtension; | |||
document.getElementById('searchField').addEventListener('keyup', updateLocalStorage); | |||
document.getElementById('searchField').addEventListener('input', updateLocalStorage); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we should change input
to change
. This stops it from updating the local storage with every added character. It also has all the correct behaviours, like when closing the extension everything saves correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brandon1024 While testing I noticed that 'change' works well when closing application through close button, but when using keyboard shortcut the changes are not stored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see this now. Strange, it only had this behavior initially for me. Input event works better, so we may just need to sacrifice a bit of performance. Can update later if we find a solution. Merging.
… on popup open
tickets: #40 #37
Duplicate issues ^^