Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // background.html
- // ---------------------
- <script src="sample.js"></script>
- // sample.js
- // ---------------------
- var localS = 0;
- chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {
- if (request.count>0){
- localS=request.count;
- sendResponse({msg: "thanks"});
- }
- else
- sendResponse({});
- });
- // contentscript.js
- // ---------------------
- var c = localStorage["engine_count"];
- chrome.extension.sendRequest({count: [c]}, function(response) {
- console.log(response.msg);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement