Skip to content

Instantly share code, notes, and snippets.

@dialtone
Created January 18, 2012 00:34
Show Gist options
  • Save dialtone/1630025 to your computer and use it in GitHub Desktop.
Save dialtone/1630025 to your computer and use it in GitHub Desktop.
<!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