Skip to content

Commit

Permalink
1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
adokseo committed Sep 17, 2020
1 parent 41ad65e commit c3412fe
Show file tree
Hide file tree
Showing 13 changed files with 443 additions and 204 deletions.
18 changes: 18 additions & 0 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,23 @@
},
"empty": {
"message": "Empty"
},
"cut": {
"message": "Cut"
},
"copy": {
"message": "Copy"
},
"paste": {
"message": "Paste"
},
"clipboard": {
"message": "Clipboard"
},
"select": {
"message": "Select"
},
"dragAndDrop": {
"message": "Drag & Drop"
}
}
Binary file added assets/icons/128.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/128.png~
Binary file not shown.
Binary file added assets/icons/16.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/16.png~
Binary file not shown.
Binary file added assets/icons/32.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/32.png~
Binary file not shown.
Binary file added assets/icons/48.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/48.png~
Binary file not shown.
78 changes: 72 additions & 6 deletions content-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ function prevent(event) {
var data = JSON.parse(SETTINGS.data[key]);

if (
data.key === HID.key &&
data.shiftKey === HID.shiftKey &&
data.ctrlKey === HID.ctrlKey &&
data.altKey === HID.altKey &&
(data.key === HID.key || isset(data.key) === false) &&
(data.shiftKey === HID.shiftKey || isset(data.shiftKey) === false) &&
(data.ctrlKey === HID.ctrlKey || isset(data.ctrlKey) === false) &&
(data.altKey === HID.altKey || isset(data.altKey) === false) &&
data.click === HID.click &&
data.context === HID.context &&
data.wheel === HID.wheel
Expand Down Expand Up @@ -202,9 +202,75 @@ window.addEventListener('mouseup', function(event) {
}
}, true);

window.addEventListener('cut', function(event) {
if (SETTINGS.data.cut !== false) {
event.stopPropagation();
}
}, true);

window.addEventListener('copy', function(event) {
if (SETTINGS.data.copy !== false) {
console.log('COPY', event);
event.stopPropagation();
}
}, true);

window.addEventListener('paste', function(event) {
if (SETTINGS.data.paste !== false) {
event.stopPropagation();
}
}, true);

window.addEventListener('select', function(event) {
if (SETTINGS.data.select !== false) {
event.stopPropagation();
}
}, true);

window.addEventListener('drag', function(event) {
if (SETTINGS.data.drag_and_drop !== false) {
event.stopPropagation();
}
}, true);

window.addEventListener('dragend', function(event) {
if (SETTINGS.data.drag_and_drop !== false) {
event.stopPropagation();
}
}, true);

window.addEventListener('dragenter', function(event) {
if (SETTINGS.data.drag_and_drop !== false) {
event.stopPropagation();
}
}, true);

window.addEventListener('dragstart', function(event) {
if (SETTINGS.data.drag_and_drop !== false) {
event.stopPropagation();
}
}, true);

window.addEventListener('dragleave', function(event) {
if (SETTINGS.data.drag_and_drop !== false) {
event.stopPropagation();
}
}, true);

window.addEventListener('dragover', function(event) {
if (SETTINGS.data.drag_and_drop !== false) {
event.stopPropagation();
}
}, true);

window.addEventListener('drop', function(event) {
if (SETTINGS.data.drag_and_drop !== false) {
event.stopPropagation();
}
}, true);

/*window.addEventListener('dbclick', prevent, true);
window.addEventListener('mousemove', prevent, true);
window.addEventListener('select', prevent, true);*/
window.addEventListener('mousemove', prevent, true);*/


/*---------------------------------------------------------------
Expand Down
8 changes: 7 additions & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
{
"manifest_version": 2,
"name": "HID control prevention",
"version": "0.61",
"version": "1.0",
"icons": {
"16": "assets/icons/16.png",
"32": "assets/icons/32.png",
"48": "assets/icons/48.png",
"128": "assets/icons/128.png"
},

"default_locale": "en",

Expand Down

0 comments on commit c3412fe

Please sign in to comment.