mirror of
https://github.com/lebr0nli/slader-extension.git
synced 2025-05-10 22:32:15 +00:00
first uploaded
This commit is contained in:
commit
50fb530d6f
BIN
sample/after.png
Normal file
BIN
sample/after.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 438 KiB |
BIN
sample/before1.png
Normal file
BIN
sample/before1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 129 KiB |
BIN
sample/before2.png
Normal file
BIN
sample/before2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 172 KiB |
BIN
slader-limit-bypass/.DS_Store
vendored
Normal file
BIN
slader-limit-bypass/.DS_Store
vendored
Normal file
Binary file not shown.
26
slader-limit-bypass/README.md
Normal file
26
slader-limit-bypass/README.md
Normal file
|
@ -0,0 +1,26 @@
|
|||
|
||||
|
||||
# Slader Chrome Extension!
|
||||
|
||||
Bypass Slader's 5 solutions limit per month to college books and remove the paywall about how many solutions left
|
||||
|
||||
|
||||
# Screenshot
|
||||
|
||||
* Before
|
||||
|
||||

|
||||

|
||||
|
||||
* After
|
||||
|
||||

|
||||
|
||||
# Usage
|
||||
|
||||
|
||||
擴充功能->開發人員選項->載入未封裝套件->選擇"slader-bypass"資料夾
|
||||
|
||||
|
||||
# 注意
|
||||
|
29
slader-limit-bypass/js/background.js
Normal file
29
slader-limit-bypass/js/background.js
Normal file
|
@ -0,0 +1,29 @@
|
|||
chrome.webRequest.onBeforeSendHeaders.addListener(function(details) {
|
||||
|
||||
var newxff = (Math.floor((Math.random()*100000000))).toString();
|
||||
var gotxff = false;
|
||||
for(var n in details.requestHeaders){
|
||||
gotxff = details.requestHeaders[n].name.toLowerCase()=="x-forwarded-for";
|
||||
if(gotxff){
|
||||
details.requestHeaders[n].value = newxff;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!gotxff){
|
||||
details.requestHeaders.push({name:"X-Forwarded-For",value:newxff});
|
||||
}
|
||||
console.log(details);
|
||||
return { requestHeaders: details.requestHeaders };
|
||||
}, {
|
||||
urls: ['*://*.slader.com/*']
|
||||
}, ['blocking', 'requestHeaders']);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
chrome.webRequest.onSendHeaders.addListener(function(details) {
|
||||
console.log(details.requestHeaders);
|
||||
return { requestHeaders: details.requestHeaders };
|
||||
}, {urls: ['*://*.slader.com/textbook/*']},
|
||||
['requestHeaders']);
|
26
slader-limit-bypass/js/content_script.js
Normal file
26
slader-limit-bypass/js/content_script.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
var elem1removed = false;
|
||||
var elemParent = document.body; /* or whatever */
|
||||
|
||||
|
||||
var observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.addedNodes && (mutation.addedNodes.length > 0)) {
|
||||
var node1 = mutation.target.querySelector('section.Paywall__footer-counter');
|
||||
if (node1) {
|
||||
node1.parentNode.removeChild(node1);
|
||||
elem1removed = true;
|
||||
|
||||
}
|
||||
|
||||
if (elem1removed) {
|
||||
observer.disconnect();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
observer.observe(elemParent, {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
24
slader-limit-bypass/manifest.json
Normal file
24
slader-limit-bypass/manifest.json
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"name": "slader bypass",
|
||||
"version": "0.1",
|
||||
"author":"Alan Li",
|
||||
"description": "slader 5 solutions limit bypass",
|
||||
"permissions": [
|
||||
"webRequest",
|
||||
"webRequestBlocking",
|
||||
"*://*.slader.com/*"
|
||||
],
|
||||
"background": {
|
||||
"scripts": [
|
||||
"js/background.js"
|
||||
],
|
||||
"persistent": true
|
||||
},
|
||||
"content_scripts": [
|
||||
{
|
||||
"matches": ["*://*.slader.com/textbook/*"],
|
||||
"js": ["js/content_script.js"]
|
||||
}
|
||||
],
|
||||
"manifest_version": 2
|
||||
}
|
Loading…
Reference in a new issue