Permalink
Browse files

Playing with a chrome extension. Not usable at the moment.

  • Loading branch information...
jrburke committed Nov 12, 2010
1 parent 3602b8d commit 2247cd0487026585a93283eb37cf49d9f55ac55e
Binary file not shown.
@@ -0,0 +1,14 @@
{
"name": "Mozilla F1",
"version": "0.7.1",
"description": "Share links fast.",
"icons": { "128": "extension-icon.png" },
"browser_action": {
"default_icon": "toolbar-button.png",
"popup": "popup.html"
},
"permissions": [
"tabs",
"https://f1.mozillamessaging.com/*"
]
}
@@ -0,0 +1,83 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>F1</title>
<style>
html,
body {
overflow: hidden;
width: 1024px;
height: 114px;
}
iframe {
border: 1px solid black;
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
</style>
</head>
<body></body>
<script>
var shareUrl = 'https://f1.mozillamessaging.com/share/',
system = 'dev';
function getPageTitle(tab) {
return tab.title;
}
function getPageDescription(tab) {
return '';
}
function getPageMedium(tab) {
return '';
}
function getPageUrl(tab) {
return tab.url;
}
function getCanonicalURL(tab) {
return '';
}
function getShortURL(tab) {
return '';
}
function previews(tab) {
return [];
}
function getThumbnailData(tab) {
return '';
}
chrome.tabs.getSelected(null, function (tab) {
var url,
options = {
title: getPageTitle(tab),
description: getPageDescription(tab),
medium: getPageMedium(tab),
url: getPageUrl(tab),
canonicalUrl: getCanonicalURL(tab),
shortUrl: getShortURL(tab),
previews: previews(tab),
system: system
};
if (!options.previews.length && !options.thumbnail) {
// then we need to make our own thumbnail
options.thumbnail = getThumbnailData();
}
url = shareUrl +
'#options=' + encodeURIComponent(JSON.stringify(options));
var iframe = document.createElement('iframe');
iframe.src = url;
document.getElementsByTagName('body')[0].appendChild(iframe);
});
</script>
</html>
Binary file not shown.

0 comments on commit 2247cd0

Please sign in to comment.