NITDgpOS / Fearch

This is a chrome extension where we can search music,video and books over ftp servers. You can add it to your chrome using this link -
https://chrome.google.com/webstore/search/fearch
MIT License
37 stars 37 forks source link

Fixes #102 : Add a suggestion list #121

Closed AvinashAgarwal14 closed 6 years ago

AvinashAgarwal14 commented 6 years ago

CORS Solved, Suggestion List is added to Fearch.

Compro-Prasad commented 6 years ago

CORS solved by just removing those comments? How come it is true? @AvinashAgarwal14 Can you elaborate/provide the lines of code that actually solved this because I too have this issue.

AvinashAgarwal14 commented 6 years ago

No,CORS was solved by adding "content_security_policy":"script-src 'self' https://www.google.com/; object-src 'self'" in manifest,json file. Actually, those comments were unnecessary that's why I removed them. Re-installing the application(Extension) after adding this line to manifest.json solved my problem.

Compro-Prasad commented 6 years ago

@AvinashAgarwal14 Thanks for your help. It would be better if you could give the commit id, file name and line number.

AvinashAgarwal14 commented 6 years ago

Okay. Commit ID - 584d9b4116349456ffe695b7b43c7ddc52a471c3 Filename - manifest.json line number - 3,4,5,412

PaliwalSparsh commented 6 years ago

Hi Avinash, you have done a really great job. Sorry, for addressing it a little bit late. We are planning to release a new version of Fearch by next week. It would be really great to have your PR as a part of that release. I will suggest a few changes it would be awesome if you can update the PR and have it be live for 1200+ users we have right now 😄

AvinashAgarwal14 commented 6 years ago

Hi, thank you it would be awesome. What changes am I supposed to do?

PaliwalSparsh commented 6 years ago

These things would suffice -

  1. Can you add autocomplete="off" on the search input field. Right now I am getting my input history being overlayed on the suggestions provided. I hope this should fix this problem.
  2. Please, can you help me understand why did you include jQuery and what problem is it solving? Any of the operation you perform using it can be done by vanilla javascript as such.
$(document).ready(function(){
    $(":not(#query)").click(function(){
        for(var i=0;i<(sug.length);i++)
                {
                    sug[i].classList.add("off");
                }
    });
});

If it is just for this piece of code. I think adding a library is not justified. You should use vanilla js only. Thankyou

AvinashAgarwal14 commented 6 years ago

Yes,

  1. autocomplete="off" will do that.
  2. This code is for hiding the suggestion list when the user clicks anywhere out of the input-field box but not when he clicks inside the input box.As selecting all elements other than a specified one easier with jquery :not selector, I used it. Anyways, will look for an alternative solution and inform you.
PaliwalSparsh commented 6 years ago

Thankyou. Let me know if you need help with something.

AvinashAgarwal14 commented 6 years ago

I have updated the PR with the required changes, please check.

PaliwalSparsh commented 6 years ago

Great work @AvinashAgarwal14 Thanks @nkprince007 @Compro-Prasad for the help with suggestions.