Skip to content
Browse files

Changes to screenshot script

  • Loading branch information...
1 parent 8f58f13 commit 71cc2208dc44b834325f8aaa7a12acada9df9528 @jakearchibald committed May 23, 2012
Showing with 5 additions and 5 deletions.
  1. +1 −1 capture-extension/manifest.json
  2. +4 −4 capture-extension/script.js
View
2 capture-extension/manifest.json
@@ -1,7 +1,7 @@
{
"name": "Capture slides",
"version": "1.0",
- "description": "Captures 1024*768 of the current tab",
+ "description": "Captures the current tab",
"browser_action": {
"default_icon": "icon19.png"
},
View
8 capture-extension/script.js
@@ -1,9 +1,10 @@
(function() {
- var index = 61;
+ var index = 0;
chrome.browserAction.onClicked.addListener(function(tab) {
chrome.tabs.captureVisibleTab(tab.windowId, {
- format: 'png'
+ format: 'jpeg',
+ quality: 40
}, function(data) {
var canvas = document.createElement('canvas'),
img = new Image();
@@ -18,14 +19,13 @@
var a = document.createElement('a');
a.href = canvas.toDataURL();
- a.download = filePrefix + '.png';
+ a.download = filePrefix + '.jpg';
a.click();
// Are we leaking?
canvas = null;
img = null;
};
-
img.src = data;
});
});

0 comments on commit 71cc220

Please sign in to comment.
Something went wrong with that request. Please try again.