Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: e42809c0b5
Fetching contributors…

Cannot retrieve contributors at this time

37 lines (34 sloc) 1.095 kB
<!DOCTYPE html>
<html>
<head>
<title>Readable JavaScript [background]</title>
<script type="text/javascript">
window.addEventListener('load', function () {
function onConnectHandler(event) {
if (event && event.origin && event.origin.indexOf('popup.html') > -1 && event.origin.indexOf('widget://') > -1) {
var tab = opera.extension.tabs.getFocused();
if (tab) {
tab.postMessage('send_bg_port', [event.source]);
}
}
}
var storage = widget.preferences;
if (storage['enable_button'] === 'true') {
var theButton;
var toolbarUIItemProperties = {
title: 'Readable JavaScript',
icon: 'icons/icon16.png',
popup: {
href: 'popup.html',
width: 600,
height: 400
}
}
theButton = opera.contexts.toolbar.createItem(toolbarUIItemProperties);
opera.contexts.toolbar.addItem(theButton);
opera.extension.onconnect = onConnectHandler;
}
}, false);
</script>
</head>
</html>
Jump to Line
Something went wrong with that request. Please try again.