Skip to content

Commit

Permalink
Merge branch 'dessant:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Serega007RU authored Dec 30, 2021
2 parents 21fd497 + 4c7dd3e commit b9a9831
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This project does not accept pull requests. Please use issues to report bugs or suggest new features.
18 changes: 18 additions & 0 deletions .github/workflows/lockdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: 'Repo Lockdown'

on:
pull_request_target:
types: opened

permissions:
pull-requests: write

jobs:
action:
runs-on: ubuntu-latest
steps:
- uses: dessant/repo-lockdown@v2
with:
exclude-pr-created-before: '2021-11-02T00:00:00Z'
pr-comment: 'This project does not accept pull requests. Please use issues to report bugs or suggest new features.'
process-only: 'prs'
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [1.3.1](https://github.com/dessant/buster/compare/v1.3.0...v1.3.1) (2021-11-02)


### Bug Fixes

* update challenge reset ([3d0fb37](https://github.com/dessant/buster/commit/3d0fb3768b05138fc0b6766b5ed107bffac4a380))

## [1.3.0](https://github.com/dessant/buster/compare/v1.2.2...v1.3.0) (2021-09-25)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "buster",
"version": "1.3.0",
"version": "1.3.1",
"author": "Armin Sebastian",
"repository": "https://github.com/dessant/buster",
"license": "GPL-3.0-only",
Expand Down
8 changes: 4 additions & 4 deletions src/background/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ function removeRequestOrigin(details) {
return {requestHeaders: headers};
}

function addBackgroundRequestLitener() {
function addBackgroundRequestListener() {
if (
!browser.webRequest.onBeforeSendHeaders.hasListener(removeRequestOrigin)
) {
Expand Down Expand Up @@ -212,7 +212,7 @@ function addBackgroundRequestLitener() {
}
}

function removeBackgroundRequestLitener() {
function removeBackgroundRequestListener() {
if (browser.webRequest.onBeforeSendHeaders.hasListener(removeRequestOrigin)) {
browser.webRequest.onBeforeSendHeaders.removeListener(removeRequestOrigin);
}
Expand Down Expand Up @@ -536,11 +536,11 @@ async function onMessage(request, sender) {
// await showContributePage('use');
// }
} else if (request.id === 'transcribeAudio') {
addBackgroundRequestLitener();
addBackgroundRequestListener();
try {
return await transcribeAudio(request.audioUrl, request.lang);
} finally {
removeBackgroundRequestLitener();
removeBackgroundRequestListener();
}
} else if (request.id === 'resetCaptcha') {
await resetCaptcha(sender.tab.id, sender.frameId, request.challengeUrl);
Expand Down
12 changes: 7 additions & 5 deletions src/content/reset.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
(function () {
const reset = function (challengeUrl) {
for (const [k, client] of Object.entries(___grecaptcha_cfg.clients)) {
for (const [id, client] of Object.entries(___grecaptcha_cfg.clients)) {
for (const [_, items] of Object.entries(client)) {
for (const [_, v] of Object.entries(items)) {
if (v instanceof Element && v.src === challengeUrl) {
(grecaptcha.reset || grecaptcha.enterprise.reset)(k);
return;
if (items instanceof Object) {
for (const [_, v] of Object.entries(items)) {
if (v instanceof Element && v.src === challengeUrl) {
(grecaptcha.reset || grecaptcha.enterprise.reset)(id);
return;
}
}
}
}
Expand Down

0 comments on commit b9a9831

Please sign in to comment.