Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions hasher.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,17 @@ var tabs = {
};

/*
* Copy to clipboard
* Copy to clipboard (Clipboard API with execCommand fallback)
*/
function copyToClipboard(id) {
$("#"+id).select();
document.execCommand('copy');
var el = document.getElementById(id);
var text = el ? (el.value || el.textContent || "") : "";
if (navigator.clipboard && navigator.clipboard.writeText) {
navigator.clipboard.writeText(text);
} else {
$("#" + id).select();
document.execCommand("copy");
}
}


Expand Down
13 changes: 7 additions & 6 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"name": "Hasher",
"version": "1.3.2",
"manifest_version": 2,
"version": "1.3.3",
"manifest_version": 3,
"description": "Developer's toolbox. Calculates MD5, SHA-1, SHA-2, IP/Subnet, URL decode, Base64 and more",
"offline_enabled": true,
"permissions": [
"clipboardWrite", "tabs"
"clipboardWrite",
"tabs"
],
"browser_action": {
"action": {
"default_icon": "images/icon.png",
"default_popup": "popup.html"
},
"icons": {
"16": "images/icon16.png",
"48": "images/icon48.png",
"16": "images/icon16.png",
"48": "images/icon48.png",
"128": "images/icon128.png"
}
}
27 changes: 3 additions & 24 deletions popup.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
$(document).ready(function() {

/*
* I decided to leave popout button on the popout page
*
if (typeof chrome.extension != "undefined") {
if (chrome.extension.getBackgroundPage().separatePopup == true) {
$("#popup").hide();
} else {
$("#popup").show();
}
}
*/

/*
* Events registration
*/
*/
$("#input").keyup(function () {
hasher.update();
});
Expand All @@ -24,18 +12,9 @@ $(document).ready(function() {

// Open separate window (pop-out)
$("#button-popout").click(function () {
if (typeof chrome.extension != "undefined") {
//chrome.extension.getBackgroundPage().separatePopup = true;
/*
chrome.windows.create({
url: 'popup.html',
type: 'popup',
width: 700,
height: 800
});
*/
if (typeof chrome.runtime !== "undefined" && chrome.runtime.getURL) {
chrome.tabs.create({
url: 'popup.html'
url: chrome.runtime.getURL("popup.html")
});
}
});
Expand Down