mirror of
https://codeberg.org/Amm0ni4/bypass-all-shortlinks-debloated.git
synced 2025-01-31 06:57:29 +05:00
stop injecting adcopy_response
This commit is contained in:
parent
5ce54931ab
commit
6d32286fa5
3 changed files with 29 additions and 5 deletions
30
3_patch.py
30
3_patch.py
|
@ -42,6 +42,18 @@ def does_not_contain_any(input_string, string_list):
|
|||
return False
|
||||
return True
|
||||
|
||||
def remove_lines_with_strings(js_code, strings_to_remove):
|
||||
# Split the JavaScript code into lines
|
||||
lines = js_code.split('\n')
|
||||
|
||||
# Filter out lines that start with the specified strings
|
||||
filtered_lines = [line for line in lines if not any(line.startswith(s) for s in strings_to_remove)]
|
||||
|
||||
# Join the filtered lines back into a string
|
||||
filtered_code = '\n'.join(filtered_lines)
|
||||
|
||||
return filtered_code
|
||||
|
||||
def modify_script_extra(file_path):
|
||||
try:
|
||||
with open(file_path, 'r', encoding='utf-8') as file:
|
||||
|
@ -67,20 +79,34 @@ def modify_script_extra(file_path):
|
|||
## Remove tracking iframe being injected
|
||||
content = remove_lines_with_url(content, "https://menrealitycalc.com/")
|
||||
|
||||
## Remove weird datalist "adcopy_response" injected
|
||||
strings_to_remove = [
|
||||
" elementReady('[name=adcopy_response]')",
|
||||
" const PHRASES = ['1.21 gigawatts'",
|
||||
" const datalist = document.createElement('datalist')"
|
||||
]
|
||||
content = remove_lines_with_strings(content, strings_to_remove)
|
||||
|
||||
|
||||
## Check known issues have been removed and remove antifeature label if corrected
|
||||
strings_to_check = [
|
||||
"rotator.nurul-huda.sch.id/?BypassResults=",
|
||||
"free4u.nurul-huda.or.id/?BypassResults=",
|
||||
"https://menrealitycalc.com/",
|
||||
"createElement('iframe')"
|
||||
"createElement('iframe')",
|
||||
"adcopy_response"
|
||||
]
|
||||
if does_not_contain_any(content, strings_to_check):
|
||||
content = content.replace("\n// @antifeature tracking", "")
|
||||
else:
|
||||
print("ERROR: TRACKING NOT REMOVED.")
|
||||
open("Bypass_All_Shortlinks.user.js", "w").close() # Clear file
|
||||
#open("Bypass_All_Shortlinks.user.js", "w").close() # Clear file
|
||||
return False
|
||||
|
||||
# Check the code ends with a line jump
|
||||
if not content.endswith('\n'):
|
||||
content += '\n'
|
||||
|
||||
# Write the modified content back to the file
|
||||
with open(file_path, 'w', encoding='utf-8') as file:
|
||||
file.write(content)
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -13,6 +13,7 @@ Automatically bypass many link shorteners [(supported_sites.txt)](https://codebe
|
|||
- The script will not redirect to 'rotator.nurul-huda.sch.id' or 'free4u.nurul-huda.or.id' before your destination URL, which are intermediary sites set by the developer for [collecting analytics](https://i.ibb.co/D1zYG1v/topcountry17-04-2023.jpg) and showing ads.
|
||||
- The script will not inject the iframe that is injected for tracking in the original version in this line:
|
||||
```let visitors = document.createElement('iframe');visitors.src = 'https://menrealitycalc.com/greasyfork';visitors.style.cssText = "width: 0%; height: 0%; border: none;";document.body.appendChild(visitors);let btz = bp('.banner-ad > script:nth-child(9)' || '.panel-body > script:nth-child(7)' || 'div.adb-top > script:nth-child(10)');```
|
||||
- The script will not inject this weird _adcopy_response_ in all the supported sites.
|
||||
|
||||
Original script by *bloggerpemula*: [greasyfork.org/scripts/431691](https://greasyfork.org/scripts/431691)
|
||||
|
||||
|
|
Loading…
Reference in a new issue