Skip to content

Commit

Permalink
chrome extension update
Browse files Browse the repository at this point in the history
  • Loading branch information
Defasium authored Nov 1, 2020
1 parent 37d8a65 commit 5afa9ee
Show file tree
Hide file tree
Showing 8 changed files with 198 additions and 0 deletions.
29 changes: 29 additions & 0 deletions js/background.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// background.js

chrome.runtime.onInstalled.addListener(function() {
chrome.storage.sync.set({power: 0}, function() {
console.log('Is inactive');
});
});

function updateIcon() {
chrome.storage.sync.get('power', function(data) {
var current = data.power;
if (++current > 1) current = 0;
chrome.browserAction.setIcon({'path': 'icon48_' + current + '.png'});
chrome.storage.sync.set({power: current}, function() {
console.log('The number is set to ' + current);
});
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
var message = 'power_on';
if (current === 0) message = 'power_off';
chrome.tabs.sendMessage(tabs[0].id, {"message": message});
});
});
};

// Called when the user clicks on the browser action.
chrome.browserAction.onClicked.addListener(function(tab) {
// Send a message to the active tab
updateIcon();
});
137 changes: 137 additions & 0 deletions js/content.js

Large diffs are not rendered by default.

Binary file added js/icon128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added js/icon48_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added js/icon48_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions js/jquery-2-git.min.js

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions js/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"manifest_version": 2,
"name": "VKCaptchaBreaker",
"description": "Google Chrome Extension which utilizes trained AI models to predict captcha from image and automatically enters it.",
"author": "Defasium (https://github.com/Defasium)",
"version": "1.1",
"permissions": ["storage", "tabs", "*://vk.com/*", "*://*.userapi.com/*"],
"background": {
"scripts": [
"background.js"
],
"persistent": false
},
"content_scripts": [
{
"matches": [
"*://vk.com/*"
],
"js": ["jquery-2-git.min.js", "content.js"]
}
],
"icons": {"48": "icon48_1.png",
"128": "icon128.png"},
"browser_action": {
"default_icon": "icon48_0.png"
},
"web_accessible_resources": ["models/*.onnx"]
}
Binary file added js/models/ctc_model_.onnx
Binary file not shown.

0 comments on commit 5afa9ee

Please sign in to comment.