-
Notifications
You must be signed in to change notification settings - Fork 4
DuoHacker Extension #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
QikseekDev
wants to merge
14
commits into
not2pixel:main
Choose a base branch
from
QikseekDev:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e9256f6
Add temporary file temp.temp
QikseekDev 3d08a1b
Add files via upload
QikseekDev 013b673
Delete extension/content.js
QikseekDev d0ab361
Delete extension/icon.png
QikseekDev e37ddc7
Delete extension/inject.js
QikseekDev 2da64e4
Delete extension/manifest.json
QikseekDev 1c22394
Delete extension/temp.temp
QikseekDev 9acfdc3
Create temp
QikseekDev 4ba03b8
Add files via upload
QikseekDev f7374b2
Add files via upload
QikseekDev 421de59
Update manifest.json for Duolingo DuoHacker v2
QikseekDev 7ffbdbc
Update manifest.json
QikseekDev efe880a
Delete extension/temp
QikseekDev cd56469
Add files via upload
QikseekDev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| const script = document.createElement('script'); | ||
|
|
||
| script.src = chrome.runtime.getURL('inject.js'); | ||
|
|
||
| script.onload = () => script.remove(); | ||
|
|
||
| (document.head || document.documentElement) | ||
| .appendChild(script); | ||
|
|
||
| console.log('[DuoHacker] loader injected'); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,298 @@ | ||
| (async () => { | ||
|
|
||
| (() => { | ||
|
|
||
| const prefix = 'usc:Duolingo_DuoHacker:'; | ||
|
|
||
| const listeners = new Map(); | ||
|
|
||
| let listenerSeq = 0; | ||
|
|
||
| function read(name, fallback) { | ||
|
|
||
| const raw = localStorage.getItem(prefix + name); | ||
|
|
||
| if (raw === null) return fallback; | ||
|
|
||
| try { | ||
| return JSON.parse(raw); | ||
| } catch { | ||
| return raw; | ||
| } | ||
| } | ||
|
|
||
| function write(name, value) { | ||
|
|
||
| const oldValue = read(name); | ||
|
|
||
| localStorage.setItem( | ||
| prefix + name, | ||
| JSON.stringify(value) | ||
| ); | ||
|
|
||
| for (const listener of listeners.values()) { | ||
|
|
||
| if (listener.name === name) { | ||
|
|
||
| listener.callback( | ||
| name, | ||
| oldValue, | ||
| value, | ||
| false | ||
| ); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| function GM_xmlhttpRequest(details) { | ||
|
|
||
| const controller = new AbortController(); | ||
|
|
||
| const promise = fetch(details.url, { | ||
|
|
||
| method: details.method || 'GET', | ||
|
|
||
| headers: details.headers, | ||
|
|
||
| body: details.data, | ||
|
|
||
| signal: controller.signal, | ||
|
|
||
| credentials: | ||
| details.anonymous | ||
| ? 'omit' | ||
| : 'include' | ||
|
|
||
| }) | ||
|
|
||
| .then(async response => { | ||
|
|
||
| const responseText = | ||
|
|
||
| details.responseType === 'blob' || | ||
| details.responseType === 'arraybuffer' | ||
|
|
||
| ? '' | ||
|
|
||
| : await response.clone().text(); | ||
|
|
||
| const body = | ||
|
|
||
| details.responseType === 'blob' | ||
|
|
||
| ? await response.blob() | ||
|
|
||
| : details.responseType === 'arraybuffer' | ||
|
|
||
| ? await response.arrayBuffer() | ||
|
|
||
| : details.responseType === 'json' | ||
|
|
||
| ? JSON.parse(responseText || 'null') | ||
|
|
||
| : responseText; | ||
|
|
||
| const xhr = { | ||
|
|
||
| response: body, | ||
|
|
||
| responseText, | ||
|
|
||
| status: response.status, | ||
|
|
||
| statusText: response.statusText, | ||
|
|
||
| finalUrl: response.url | ||
|
|
||
| }; | ||
|
|
||
| details.onload?.(xhr); | ||
|
|
||
| return xhr; | ||
|
|
||
| }) | ||
|
|
||
| .catch(error => { | ||
|
|
||
| details.onerror?.(error); | ||
|
|
||
| throw error; | ||
|
|
||
| }); | ||
|
|
||
| return { | ||
|
|
||
| abort: () => controller.abort(), | ||
|
|
||
| then: promise.then.bind(promise), | ||
|
|
||
| catch: promise.catch.bind(promise), | ||
|
|
||
| finally: promise.finally.bind(promise) | ||
|
|
||
| }; | ||
| } | ||
|
|
||
| function GM_addStyle(css) { | ||
|
|
||
| const style = document.createElement('style'); | ||
|
|
||
| style.textContent = css; | ||
|
|
||
| document.head.appendChild(style); | ||
|
|
||
| return style; | ||
| } | ||
|
|
||
| const GM_info = { | ||
|
|
||
| script: { | ||
|
|
||
| name: 'Duolingo DuoHacker', | ||
|
|
||
| description: | ||
| 'The #1 Duolingo hack', | ||
|
|
||
| version: '2026.05.25' | ||
|
|
||
| }, | ||
|
|
||
| scriptHandler: | ||
| 'Chrome Extension Harness', | ||
|
|
||
| version: '3.0' | ||
|
|
||
| }; | ||
|
|
||
| const GM = { | ||
|
|
||
| info: GM_info, | ||
|
|
||
| getValue: (name, fallback) => | ||
| Promise.resolve(read(name, fallback)), | ||
|
|
||
| setValue: (name, value) => | ||
| Promise.resolve(write(name, value)), | ||
|
|
||
| deleteValue: name => | ||
| Promise.resolve( | ||
| localStorage.removeItem(prefix + name) | ||
| ), | ||
|
|
||
| listValues: () => | ||
| Promise.resolve( | ||
| Object.keys(localStorage) | ||
|
|
||
| .filter(key => | ||
| key.startsWith(prefix) | ||
| ) | ||
|
|
||
| .map(key => | ||
| key.slice(prefix.length) | ||
| ) | ||
| ), | ||
|
|
||
| addValueChangeListener: | ||
| (name, callback) => { | ||
|
|
||
| const id = ++listenerSeq; | ||
|
|
||
| listeners.set(id, { | ||
| name, | ||
| callback | ||
| }); | ||
|
|
||
| return id; | ||
| }, | ||
|
|
||
| removeValueChangeListener: | ||
| id => listeners.delete(id), | ||
|
|
||
| addStyle: GM_addStyle, | ||
|
|
||
| xmlHttpRequest: details => | ||
| Promise.resolve( | ||
| GM_xmlhttpRequest(details) | ||
| ), | ||
|
|
||
| xmlhttpRequest: details => | ||
| Promise.resolve( | ||
| GM_xmlhttpRequest(details) | ||
| ), | ||
|
|
||
| registerMenuCommand: | ||
| () => undefined, | ||
|
|
||
| setClipboard: text => | ||
| navigator.clipboard.writeText( | ||
| String(text || '') | ||
| ) | ||
| }; | ||
|
|
||
| Object.assign(window, { | ||
|
|
||
| GM, | ||
|
|
||
| GM_info, | ||
|
|
||
| GM_getValue: read, | ||
|
|
||
| GM_setValue: write, | ||
|
|
||
| GM_deleteValue: name => | ||
| localStorage.removeItem(prefix + name), | ||
|
|
||
| GM_listValues: () => | ||
|
|
||
| Object.keys(localStorage) | ||
|
|
||
| .filter(key => | ||
| key.startsWith(prefix) | ||
| ) | ||
|
|
||
| .map(key => | ||
| key.slice(prefix.length) | ||
| ), | ||
|
|
||
| GM_addValueChangeListener: | ||
| GM.addValueChangeListener, | ||
|
|
||
| GM_removeValueChangeListener: | ||
| GM.removeValueChangeListener, | ||
|
|
||
| GM_addStyle, | ||
|
|
||
| GM_xmlhttpRequest, | ||
|
|
||
| GM_registerMenuCommand: | ||
| () => undefined, | ||
|
|
||
| unsafeWindow: window | ||
|
|
||
| }); | ||
|
|
||
| })(); | ||
|
|
||
| try { | ||
|
|
||
| const res = await fetch( | ||
| 'https://raw.githubusercontent.com/not2pixel/DuoHacker/main/v2/duohacker-v2.user.js' | ||
| ); | ||
|
|
||
| const code = await res.text(); | ||
|
|
||
| eval(code); | ||
|
|
||
|
QikseekDev marked this conversation as resolved.
|
||
| console.log( | ||
| '[DuoHacker] injected successfully' | ||
| ); | ||
|
|
||
| } catch (err) { | ||
|
|
||
| console.error( | ||
| '[DuoHacker] injection failed:', | ||
| err | ||
| ); | ||
| } | ||
|
|
||
| })(); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| { | ||
| "manifest_version": 3, | ||
|
|
||
| "name": "Duolingo DuoHacker v2", | ||
|
|
||
| "version": "1.0", | ||
|
|
||
| "description": "Duolingo DuoHacker — Browser Extension", | ||
|
|
||
| "icons": { | ||
| "128": "icon.png" | ||
| }, | ||
|
|
||
| "content_scripts": [ | ||
| { | ||
| "matches": [ | ||
| "https://*.duolingo.com/*", | ||
| "https://*.duolingo.cn/*" | ||
| ], | ||
|
|
||
| "js": [ | ||
| "content.js" | ||
| ], | ||
|
|
||
| "run_at": "document_end" | ||
| } | ||
| ], | ||
|
|
||
| "host_permissions": [ | ||
| "https://*.duolingo.com/*", | ||
| "https://*.duolingo.cn/*", | ||
|
|
||
| "https://raw.githubusercontent.com/*", | ||
|
|
||
| "https://avatars.githubusercontent.com/*", | ||
|
|
||
| "https://fonts.googleapis.com/*", | ||
|
|
||
| "https://greasyfork.org/*", | ||
|
|
||
| "https://api.twisk.fun/*", | ||
|
|
||
| "https://stories.duolingo.com/*", | ||
|
|
||
| "https://goals-api.duolingo.com/*", | ||
|
|
||
| "https://duolingo-leaderboards-prod.duolingo.com/*" | ||
| ], | ||
|
|
||
| "web_accessible_resources": [ | ||
| { | ||
| "resources": [ | ||
| "inject.js" | ||
| ], | ||
|
|
||
| "matches": [ | ||
| "https://*.duolingo.com/*", | ||
| "https://*.duolingo.cn/*" | ||
| ] | ||
| } | ||
| ] | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.