-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #285 from satyam8932/master
Feature : Full Page Screenshot for Chrome Extension
- Loading branch information
Showing
6 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Full Page Screenshot</title> | ||
<link rel="stylesheet" href="src/popup.css"> | ||
</head> | ||
<body> | ||
<button id="capture">Capture Screenshot</button> | ||
<script src="scripts/popup.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"manifest_version": 3, | ||
"name": "Full Page Screenshot", | ||
"version": "1.0", | ||
"description": "A Chrome extension to capture full-page screenshots.", | ||
"permissions": ["activeTab"], | ||
"background": { | ||
"service_worker": "background.js" | ||
}, | ||
"icons": { | ||
"16": "src/icon.jpg", | ||
"48": "src/icon.jpg", | ||
"128": "src/icon.jpg" | ||
}, | ||
"browser_action": { | ||
"default_popup": "popup.html", | ||
"default_icon": "icon.png" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
chrome.browserAction.onClicked.addListener(function(tab) { | ||
chrome.tabs.captureVisibleTab(null, { format: 'png', quality: 100 }, function(dataUrl) { | ||
var link = document.createElement('a'); | ||
link.href = dataUrl; | ||
link.download = 'full-page-screenshot.png'; | ||
link.click(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
document.getElementById('capture').addEventListener('click', function() { | ||
chrome.runtime.sendMessage({ action: 'captureScreenshot' }); | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
body { | ||
font-family: Arial, sans-serif; | ||
text-align: center; | ||
margin: 0; | ||
padding: 20px; | ||
} | ||
|
||
button { | ||
padding: 10px 20px; | ||
background-color: #007bff; | ||
color: #fff; | ||
border: none; | ||
cursor: pointer; | ||
border-radius: 5px; | ||
font-size: 16px; | ||
} |