Skip to content

Commit

Permalink
v1.1.0
Browse files Browse the repository at this point in the history
Tor Search Engine Bypass added and other Bug fixes
  • Loading branch information
cookie0o authored Feb 25, 2024
1 parent dfa257a commit 7cf0f80
Show file tree
Hide file tree
Showing 8 changed files with 185 additions and 82 deletions.
2 changes: 1 addition & 1 deletion dep/UIdep/searchbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

AutoCompleteWords = [
"github.com", "youtube.com", "twitch.tv", "reddit.com", "spotify.com", "github.com/cookie0o", "facebook.com", "wikipedia.com", "amazon.com", "instagram.com", "yahoo.com", "twitter.com",
"naver.com", "bit.ly", "vk.com", "live.com", "gmail.com", "google.com", "duckduckgo.com"
"naver.com", "bit.ly", "vk.com", "live.com", "gmail.com", "google.com", "duckduckgo.com", "dnsleaktest.com"
]


Expand Down
128 changes: 80 additions & 48 deletions dep/UIdep/settingspage.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
current_dir = os.path.dirname(os.path.realpath(__file__)).replace("\\", "/")

close_png = current_dir+'/UIres/close.png'
info_png = current_dir+'/UIres/info.png'

height = 2

Expand Down Expand Up @@ -121,7 +122,7 @@ def settingssetupUi(self, wpWidget):
self.CustomUserAgent_radioButton.setStyleSheet("color: rgb(255, 255, 255);")
self.CustomUserAgent_radioButton.setObjectName("CustomUserAgent_radioButton")
self.label_7 = QtWidgets.QLabel(self.scrollAreaWidgetContents)
self.label_7.setGeometry(QtCore.QRect(5, 339, 300, 21))
self.label_7.setGeometry(QtCore.QRect(5, 339, 297, 21))
font = QtGui.QFont()
font.setPointSize(11)
self.label_7.setFont(font)
Expand All @@ -135,50 +136,48 @@ def settingssetupUi(self, wpWidget):
self.RouteTrafficThroughTor_checkBox.setStyleSheet("color: rgb(255, 255, 255);")
self.RouteTrafficThroughTor_checkBox.setObjectName("RouteTrafficThroughTor_checkBox")
self.label_8 = QtWidgets.QLabel(self.scrollAreaWidgetContents)
self.label_8.setGeometry(QtCore.QRect(5, 380, 300, 30))
self.label_8.setStyleSheet("color: rgb(255, 255, 255);")
self.label_8.setGeometry(QtCore.QRect(5, 369, 300, 41))
self.label_8.setStyleSheet("color: rgb(255, 255, 255);\n"
"background-color: transparent;")
self.label_8.setTextFormat(QtCore.Qt.PlainText)
self.label_8.setWordWrap(True)
self.label_8.setObjectName("label_8")
self.TrackingLinkProtection_checkBox = QtWidgets.QCheckBox(self.scrollAreaWidgetContents)
self.TrackingLinkProtection_checkBox.setGeometry(QtCore.QRect(5, 410, 300, 30))
self.TrackingLinkProtection_checkBox.setGeometry(QtCore.QRect(5, 430, 300, 30))
font = QtGui.QFont()
font.setPointSize(11)
self.TrackingLinkProtection_checkBox.setFont(font)
self.TrackingLinkProtection_checkBox.setStyleSheet("color: rgb(255, 255, 255);")
self.TrackingLinkProtection_checkBox.setStyleSheet("color: rgb(255, 255, 255);\n"
"background-color: qconicalgradient(cx:0, cy:0, angle:135, stop:0 rgba(255, 255, 255, 0));")
self.TrackingLinkProtection_checkBox.setObjectName("TrackingLinkProtection_checkBox")
self.label_9 = QtWidgets.QLabel(self.scrollAreaWidgetContents)
self.label_9.setGeometry(QtCore.QRect(5, 430, 300, 30))
self.label_9.setStyleSheet("color: rgb(255, 255, 255);")
self.label_9.setTextFormat(QtCore.Qt.PlainText)
self.label_9.setWordWrap(True)
self.label_9.setObjectName("label_9")
self.label_10 = QtWidgets.QLabel(self.scrollAreaWidgetContents)
self.label_10.setGeometry(QtCore.QRect(5, 460, 300, 20))
self.label_10.setGeometry(QtCore.QRect(5, 469, 300, 31))
font = QtGui.QFont()
font.setPointSize(11)
self.label_10.setFont(font)
self.label_10.setStyleSheet("color: rgb(255, 255, 255);")
self.label_10.setObjectName("label_10")
self.widget_2 = QtWidgets.QWidget(self.scrollAreaWidgetContents)
self.widget_2.setGeometry(QtCore.QRect(0, 480, 301, 41))
self.widget_2.setGeometry(QtCore.QRect(0, 490, 301, 51))
self.widget_2.setObjectName("widget_2")
self.OffProxy_radioButton = QtWidgets.QRadioButton(self.widget_2)
self.OffProxy_radioButton.setGeometry(QtCore.QRect(5, 0, 300, 21))
self.OffProxy_radioButton.setGeometry(QtCore.QRect(5, 0, 281, 31))
font = QtGui.QFont()
font.setPointSize(11)
self.OffProxy_radioButton.setFont(font)
self.OffProxy_radioButton.setStyleSheet("color: rgb(255, 255, 255);")
self.OffProxy_radioButton.setObjectName("OffProxy_radioButton")
self.CustomProxy_radioButton = QtWidgets.QRadioButton(self.widget_2)
self.CustomProxy_radioButton.setGeometry(QtCore.QRect(5, 20, 300, 21))
self.CustomProxy_radioButton.setGeometry(QtCore.QRect(5, 21, 301, 31))
font = QtGui.QFont()
font.setPointSize(11)
self.CustomProxy_radioButton.setFont(font)
self.CustomProxy_radioButton.setStyleSheet("color: rgb(255, 255, 255);")
self.CustomProxy_radioButton.setObjectName("CustomProxy_radioButton")
self.CustomProxy_radioButton.raise_()
self.OffProxy_radioButton.raise_()
self.ProxyInput_widget = QtWidgets.QWidget(self.scrollAreaWidgetContents)
self.ProxyInput_widget.setGeometry(QtCore.QRect(0, 520, 371, 90))
self.ProxyInput_widget.setGeometry(QtCore.QRect(0, 540, 371, 90))
self.ProxyInput_widget.setObjectName("ProxyInput_widget")
self.label_11 = QtWidgets.QLabel(self.ProxyInput_widget)
self.label_11.setGeometry(QtCore.QRect(5, 0, 300, 16))
Expand All @@ -205,7 +204,7 @@ def settingssetupUi(self, wpWidget):
self.ApplyProxy_pushButton.setStyleSheet("color: rgb(255, 255, 255);")
self.ApplyProxy_pushButton.setObjectName("ApplyProxy_pushButton")
self.label_13 = QtWidgets.QLabel(self.ProxyInput_widget)
self.label_13.setGeometry(QtCore.QRect(5, 70, 300, 21))
self.label_13.setGeometry(QtCore.QRect(5, 70, 291, 21))
self.label_13.setStyleSheet("color: rgb(255, 255, 255);")
self.label_13.setTextFormat(QtCore.Qt.PlainText)
self.label_13.setWordWrap(True)
Expand All @@ -218,6 +217,27 @@ def settingssetupUi(self, wpWidget):
self.UserAgentInput_plainTextEdit.setStyleSheet("color: rgb(255, 255, 255);")
self.UserAgentInput_plainTextEdit.setPlainText("")
self.UserAgentInput_plainTextEdit.setObjectName("UserAgentInput_plainTextEdit")
self.TorSearchEngineBypass_checkBox = QtWidgets.QCheckBox(self.scrollAreaWidgetContents)
self.TorSearchEngineBypass_checkBox.setGeometry(QtCore.QRect(5, 399, 300, 31))
font = QtGui.QFont()
font.setPointSize(11)
self.TorSearchEngineBypass_checkBox.setFont(font)
self.TorSearchEngineBypass_checkBox.setStyleSheet("color: rgb(255, 255, 255);")
self.TorSearchEngineBypass_checkBox.setObjectName("TorSearchEngineBypass_checkBox")
self.label_14 = QtWidgets.QLabel(self.scrollAreaWidgetContents)
self.label_14.setGeometry(QtCore.QRect(5, 420, 311, 16))
self.label_14.setStyleSheet("color: rgb(255, 255, 255);\n"
"background-color: transparent;")
self.label_14.setTextFormat(QtCore.Qt.PlainText)
self.label_14.setWordWrap(True)
self.label_14.setObjectName("label_14")
self.label_15 = QtWidgets.QLabel(self.scrollAreaWidgetContents)
self.label_15.setGeometry(QtCore.QRect(5, 450, 300, 21))
self.label_15.setStyleSheet("color: rgb(255, 255, 255);\n"
"background-color: transparent;")
self.label_15.setTextFormat(QtCore.Qt.PlainText)
self.label_15.setWordWrap(True)
self.label_15.setObjectName("label_15")
self.label_5.raise_()
self.CloseSettings_pushButton.raise_()
self.label_3.raise_()
Expand All @@ -232,16 +252,18 @@ def settingssetupUi(self, wpWidget):
self.RandomUserAgent_radioButton.raise_()
self.CustomUserAgent_radioButton.raise_()
self.label_7.raise_()
self.RouteTrafficThroughTor_checkBox.raise_()
self.label_8.raise_()
self.label_9.raise_()
self.TrackingLinkProtection_checkBox.raise_()
self.label_10.raise_()
self.widget_2.raise_()
self.ProxyInput_widget.raise_()
self.UserAgentInput_widget.raise_()
self.TorSearchEngineBypass_checkBox.raise_()
self.RouteTrafficThroughTor_checkBox.raise_()
self.label_15.raise_()
self.TrackingLinkProtection_checkBox.raise_()
self.label_8.raise_()
self.label_14.raise_()
self.label_10.raise_()
self.scrollArea.setWidget(self.scrollAreaWidgetContents)
self.CloseSettings_pushButton.setStyleSheet("""
button = ("""
QPushButton{
background-color:rgba(0, 0, 0, 0);
color:rgb(255, 255, 255);
Expand All @@ -256,6 +278,7 @@ def settingssetupUi(self, wpWidget):
padding-left:5px;
}
""")
self.CloseSettings_pushButton.setStyleSheet(button)

self.retranslateUi(wpWidget)
QtCore.QMetaObject.connectSlotsByName(wpWidget)
Expand All @@ -278,6 +301,7 @@ def settingssetupUi(self, wpWidget):
self.UserAgentInput_plainTextEdit.setPlainText(self.custom_user_agent_input)
# [Privacy]
self.RouteTrafficThroughTor_checkBox.setChecked(self.RouteTrafficThroughTor)
self.TorSearchEngineBypass_checkBox.setChecked(self.TorSearchEngineBypass)
self.TrackingLinkProtection_checkBox.setChecked(self.TrackingLinkProtection)
# [Proxy]
self.OffProxy_radioButton.setChecked(self.OffProxy)
Expand All @@ -299,14 +323,15 @@ def settingssetupUi(self, wpWidget):
self.UserAgentInput_plainTextEdit.textChanged.connect(lambda: self.setUserAgentInput())
# [Privacy]
self.RouteTrafficThroughTor_checkBox.toggled.connect(lambda state: self.setRouteTrafficThroughTor(state))
self.TorSearchEngineBypass_checkBox.toggled.connect(lambda state: self.setTorSearchEngineBypass(state))
self.TrackingLinkProtection_checkBox.toggled.connect(lambda state: self.setTrackingLinkProtection(state))
# [Proxy]
self.OffProxy_radioButton.toggled.connect(lambda state: self.setOffProxy(state))
self.CustomProxy_radioButton.toggled.connect(lambda state: self.setCustomProxy(state))
self.CustomProxyAddress_lineEdit.textChanged.connect(lambda: self.setCustomProxyAddress())
self.CustomProxyPort_lineEdit.textChanged.connect(lambda: self.setCustomProxyPort())
self.ApplyProxy_pushButton.clicked.connect(lambda state: self.setApplyProxy(state))

def setJavascript(self, state):
if state == 0: self.javascript = False
else: self.javascript = True
Expand Down Expand Up @@ -349,6 +374,11 @@ def setUserAgentInput(self):
def setRouteTrafficThroughTor(self, state):
if state == 0: self.RouteTrafficThroughTor = False
else: self.RouteTrafficThroughTor = True
self.settings_apply()

def setTorSearchEngineBypass(self, state):
if state == 0: self.TorSearchEngineBypass = False
else: self.TorSearchEngineBypass = True
self.settings_apply()

def setTrackingLinkProtection(self, state):
Expand Down Expand Up @@ -384,27 +414,29 @@ def retranslateUi(self, wpWidget):
_translate = QtCore.QCoreApplication.translate
self.label_5.setText(_translate("wpWidget", "Settings"))
self.label_3.setText(_translate("wpWidget", "General"))
self.DisableJavascript_checkBox.setText(_translate("wpWidget", "Load Javascript"))
self.label_4.setText(_translate("Form", "Blocker"))
self.AdBlocker_checkBox.setText(_translate("Form", "Ad Blocker"))
self.TrackerBlocker_checkBox.setText(_translate("Form", "Tracker Blocker"))
self.CookieBlocker_checkBox.setText(_translate("Form", "Cookie Blocker"))
self.label_2.setText(_translate("Form", "Ad, Tracker and Cookie blocker will slow down your browser!"))
self.label_6.setText(_translate("Form", "User Agent"))
self.DefaultUserAgent_radioButton.setText(_translate("Form", "Default"))
self.RandomUserAgent_radioButton.setText(_translate("Form", "Random"))
self.CustomUserAgent_radioButton.setText(_translate("Form", "Custom"))
self.label_7.setText(_translate("Form", "Privacy"))
self.RouteTrafficThroughTor_checkBox.setText(_translate("Form", "Route Traffic through Tor"))
self.label_8.setText(_translate("Form", "Tor routing will make your browser slower, default search engine will be changed to duckduckgo.com"))
self.TrackingLinkProtection_checkBox.setText(_translate("Form", "Tracking Link Protection"))
self.label_9.setText(_translate("Form", "Will try to block ip grabber links from sites like \"grabify.link\""))
self.label_10.setText(_translate("Form", "Proxy"))
self.OffProxy_radioButton.setText(_translate("Form", "OFF"))
self.CustomProxy_radioButton.setText(_translate("Form", "Custom"))
self.label_11.setText(_translate("Form", "Address"))
self.CustomProxyAddress_lineEdit.setPlaceholderText(_translate("Form", "ProxyXY.com"))
self.label_12.setText(_translate("Form", "Port"))
self.CustomProxyPort_lineEdit.setPlaceholderText(_translate("Form", "7773"))
self.ApplyProxy_pushButton.setText(_translate("Form", "Apply Proxy"))
self.label_13.setText(_translate("Form", "Proxy will be deactivated when tor Routing is active"))
self.DisableJavascript_checkBox.setText(_translate("wpWidget", "Disable Javascript"))
self.label_4.setText(_translate("wpWidget", "Blocker"))
self.AdBlocker_checkBox.setText(_translate("wpWidget", "Ad Blocker"))
self.TrackerBlocker_checkBox.setText(_translate("wpWidget", "Tracker Blocker"))
self.CookieBlocker_checkBox.setText(_translate("wpWidget", "Cookie Blocker"))
self.label_2.setText(_translate("wpWidget", "Ad, Tracker and Cookie blocker will slow down your browser!"))
self.label_6.setText(_translate("wpWidget", "User Agent"))
self.DefaultUserAgent_radioButton.setText(_translate("wpWidget", "Default"))
self.RandomUserAgent_radioButton.setText(_translate("wpWidget", "Random"))
self.CustomUserAgent_radioButton.setText(_translate("wpWidget", "Custom"))
self.label_7.setText(_translate("wpWidget", "Privacy"))
self.RouteTrafficThroughTor_checkBox.setText(_translate("wpWidget", "Route Traffic through Tor"))
self.label_8.setText(_translate("wpWidget", "Tor routing will make your browser slower, default search engine will be changed to duckduckgo.com"))
self.TrackingLinkProtection_checkBox.setText(_translate("wpWidget", "Tracking Link Protection"))
self.label_10.setText(_translate("wpWidget", "Proxy"))
self.OffProxy_radioButton.setText(_translate("wpWidget", "OFF"))
self.CustomProxy_radioButton.setText(_translate("wpWidget", "Custom"))
self.label_11.setText(_translate("wpWidget", "Address"))
self.CustomProxyAddress_lineEdit.setPlaceholderText(_translate("wpWidget", "ProxyXY.com"))
self.label_12.setText(_translate("wpWidget", "Port"))
self.CustomProxyPort_lineEdit.setPlaceholderText(_translate("wpWidget", "7773"))
self.ApplyProxy_pushButton.setText(_translate("wpWidget", "Apply Proxy"))
self.label_13.setText(_translate("wpWidget", "Proxy will be deactivated when tor Routing is active"))
self.TorSearchEngineBypass_checkBox.setText(_translate("wpWidget", "Tor Search Engine Bypass"))
self.label_14.setText(_translate("wpWidget", "Tor bypass (Ip wont be hidden on Search Engine sites)"))
self.label_15.setText(_translate("wpWidget", "Will try to block ip grabber links from sites like \"grabify.link\""))
9 changes: 1 addition & 8 deletions dep/UIdep/tabbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
# import outside python
from dep.python.functions import functions

# import UI components
from dep.UIdep.settingspage import Ui_settings
from dep.UIdep.searchbar import Ui_searchbar

# get dir
current_dir = os.path.dirname(os.path.realpath(__file__)).replace("\\", "/")

Expand Down Expand Up @@ -105,7 +101,4 @@ def close_current_tab(self, index):
# self.browser.setAudioMuted(True)
# else:pass
# else remove the tab
self.tabs.removeTab(index)



self.tabs.removeTab(index)
7 changes: 4 additions & 3 deletions dep/config.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Developer]
debug_block_engine = true
debug_block_engine = false
debug_javascriptconsolemessage = False

[General]
Expand Down Expand Up @@ -31,8 +31,9 @@ custom_user_agent = False
custom_user_agent_input =

[Privacy]
routetrafficthroughtor = False
trackinglinkprotection = False
routetrafficthroughtor = True
torsearchenginebypass = True
trackinglinkprotection = True

[Proxy]
offproxy = True
Expand Down
29 changes: 26 additions & 3 deletions dep/python/functions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from PyQt5.QtNetwork import QNetworkProxy
from PyQt5.QtWebEngineWidgets import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
Expand All @@ -6,6 +7,7 @@
import os

# import outside python
from dep.python.search_engines import *
from dep.python.fake import *

# get current dir
Expand All @@ -28,7 +30,7 @@


class functions():
# showContextMenu, UpdateUserAgent, get_profile
# showContextMenu, UpdateUserAgent, get_profile, TorSearchEngineBypassFunc
class misc():
def showContextMenu(self):
# get mouse position
Expand Down Expand Up @@ -76,6 +78,25 @@ def set_url(self):
return self.tor_search_engine
else:
return self.search_engine

# Tor Search Engine Bypass
def TorSearchEngineBypassFunc(self, url=None):
# only active when tor routing is on
if self.RouteTrafficThroughTor:
if self.TorSearchEngineBypass:
self.browser.stop()
if url is None:
url = self.browser.url().host().replace("www.", "")
if url in SearchEngineUrl:
QNetworkProxy.setApplicationProxy(QNetworkProxy(QNetworkProxy.NoProxy))
else:
# set proxy
self.proxy.setType(QNetworkProxy.Socks5Proxy)
self.proxy.setHostName("127.0.0.1")
self.proxy.setPort(self.socks_port)
# set proxy
QNetworkProxy.setApplicationProxy(self.proxy)
self.browser.reload()


# set_tab_title, update_urlbar, add_new_tab, navigate_to_url,
Expand Down Expand Up @@ -114,7 +135,6 @@ def set_tab_title(i, browser, tabs, title):
def update_urlbar(self, q, browser = None):
if browser != self.tabs.currentWidget():
return
raw_url = q.toString()

# set text to the url bar
self.urlbar.setText(q.toString())
Expand All @@ -129,7 +149,7 @@ def add_new_tab(self, tabs, qurl = None, label ="Blank"):
# if url is blank
if qurl is None:
# creating aurl
qurl = self.set_url()
qurl = tabs.set_url()

# creating a QWebEngineView object
self.browser = QWebEngineView()
Expand Down Expand Up @@ -198,6 +218,9 @@ def navigate_to_url(self):
q.setScheme("https")
else:
pass

# check Tor Search EngineBypass before loading
functions.misc.TorSearchEngineBypassFunc(self, q)
# set the url
self.tabs.currentWidget().load(q)

Expand Down
Loading

0 comments on commit 7cf0f80

Please sign in to comment.