commit 1a9fb5e7adb2561e6f6f20b2963fcd7fad67da40 Author: Alexandr Date: Thu Jun 3 09:24:11 2021 +0300 init diff --git a/icon.png b/icon.png new file mode 100644 index 0000000..1693473 Binary files /dev/null and b/icon.png differ diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..af3dfb8 --- /dev/null +++ b/manifest.json @@ -0,0 +1,25 @@ +{ + "description": "hCaptcha Interceptor", + "applications": { + "gecko": { + "id": "yeghieFeiP3l@AlexandrSokolov" + } + }, + "manifest_version": 2, + "minimum_chrome_version": "76.0", + "name": "cloudflare-hcaptcha-interceptor", + "version": "0.0.1", + "author": "Alexandr Sokolov", + "homepage_url": "https://github.com/alexsok-bit/selenium_helper", + "icons": { + "48": "icon.png" + }, + "permissions": [ + "webRequest", + "webRequestBlocking", + "*://*/*" + ], + "background": { + "scripts": ["src/backgroung.js"] + } +} diff --git a/src/backgroung.js b/src/backgroung.js new file mode 100644 index 0000000..26e3d46 --- /dev/null +++ b/src/backgroung.js @@ -0,0 +1,20 @@ +function interceptor(details) { + let response = browser.webRequest.filterResponseData(details.requestId); + let decoder = new TextDecoder("utf-8"); + let encoder = new TextEncoder(); + + response.ondata = event => { + let str = decoder.decode(event.data, {stream: true}); + str = str.replace('