Skip to content

Commit

Permalink
Merge pull request #73 from richa208/quick-search
Browse files Browse the repository at this point in the history
Quick Search implemented
  • Loading branch information
AdiChat committed Mar 16, 2018
2 parents ef60098 + 1ae05ff commit d6b3490
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 1 deletion.
17 changes: 16 additions & 1 deletion code/background.js
Expand Up @@ -2,6 +2,21 @@ chrome.browserAction.onClicked.addListener(function(tab) {
chrome.tabs.create({
'url': chrome.extension.getURL('popup.html')
}, function(tab) {
localStorage.setItem("openThroughWeb", "no");
});
});
//it listens to messages sent by content scripts
chrome.runtime.onMessage.addListener(
function(request, sender, sendResponse) {
if (request.clicked == "true")
{
chrome.tabs.create({
'url': chrome.extension.getURL('popup.html')
}, function(tab) {

});
});
localStorage.setItem("value", request.value);//saves the query that user has selected
localStorage.setItem("openThroughWeb", "yes");
sendResponse({mesg: "response received"});
}
});
38 changes: 38 additions & 0 deletions code/contentScript.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions code/js/popup.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions code/manifest.json
Expand Up @@ -18,6 +18,12 @@
"48": "icon/icon.png",
"128": "icon/icon.png"
},
"content_scripts": [
{
"matches": ["https://*/*"],
"js": ["js/jquery.js","contentScript.js"]
}
],
"content_security_policy": "script-src 'self' https://ajax.googleapis.com; object-src 'self'",
"short_name": "World's first offline search engine: Quark"
}

0 comments on commit d6b3490

Please sign in to comment.