Created
January 18, 2012 00:34
-
-
Save dialtone/1630025 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<!-- | |
* Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this | |
* source code is governed by a BSD-style license that can be found in the | |
* LICENSE file. | |
--> | |
<html> | |
<head> | |
</head> | |
<body> | |
<script src="jquery.js"></script> | |
<script> | |
var show = true; | |
/** | |
* Handles requests sent by the content script. Shows an infobar. | |
*/ | |
function onRequest(request, sender, sendResponse) { | |
if(request.msg == 'show'){ | |
show = request.data; | |
sendResponse({}); | |
} | |
else if(request.msg == 'getShow'){ | |
sendResponse({ | |
data: show | |
}); | |
} | |
}; | |
// Listen for the content script to send a message to the background page. | |
chrome.extension.onRequest.addListener(onRequest); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment