-
Notifications
You must be signed in to change notification settings - Fork 2
/
background.html
26 lines (24 loc) · 979 Bytes
/
background.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<html>
<head>
<script type="text/javascript" src="format.js"></script>
<script type="text/javascript" src="options.js"></script>
<script type="text/javascript">
var lastClicked = {};
chrome.extension.onRequest.addListener(function (msg, sender, sendResponse) {
// close the previous connection
// in cases where user right-clicked, but didn't copy link text
// if we right-click somewhere (for another reason) then close the tab
// we end up trying to use a disconnected port object which breaks the extension entirely
// so leave off for now
// TODO: figure out how to cleanup
// if ( lastClicked["callback"] ) lastClicked["callback"]();
lastClicked["callback"] = sendResponse;
lastClicked["message"] = msg;
});
init_context_menus();
</script>
</head>
<body>
<textarea id="tmp-clipboard"></textarea>
</body>
</html>