mirror of
https://github.com/Pardus-LiderAhenk/ahenk
synced 2024-11-22 03:52:17 +03:00
edited code
This commit is contained in:
parent
5a460eab4a
commit
c0e52dec12
1 changed files with 14 additions and 8 deletions
|
@ -88,17 +88,23 @@ class BrowserChrome(AbstractPlugin):
|
||||||
def write_to_chrome_proxy(self):
|
def write_to_chrome_proxy(self):
|
||||||
proxy_full_path = self.local_settings_proxy_profile + self.local_settings_proxy_file
|
proxy_full_path = self.local_settings_proxy_profile + self.local_settings_proxy_file
|
||||||
self.silent_remove(proxy_full_path)
|
self.silent_remove(proxy_full_path)
|
||||||
# proxy preference lenght bak varsa çalıştır yoksa passs
|
|
||||||
# if len(proxy_preferences) > 0:
|
|
||||||
self.create_file(proxy_full_path)
|
self.create_file(proxy_full_path)
|
||||||
proxy_preferences = json.loads(self.data)
|
proxy_preferences = json.loads(self.data)
|
||||||
content = " "
|
line = ""
|
||||||
if len(proxy_preferences) > 0:
|
if len(proxy_preferences) > 0:
|
||||||
for proxy in proxy_preferences["proxyListChrome"]:
|
proxy_data = proxy_preferences["proxyListChrome"]
|
||||||
line = ""
|
self.logger.debug(proxy_data)
|
||||||
line += str(proxy["preferenceName"])
|
if proxy_data[0].get('value') == '0' :
|
||||||
content += line
|
line = proxy_data[1].get('preferenceName')
|
||||||
self.write_file(proxy_full_path, content)
|
|
||||||
|
elif proxy_data[0].get('value') == '1':
|
||||||
|
for proxy in proxy_data[1:5]:
|
||||||
|
line += str(proxy['preferenceName'] + "\n")
|
||||||
|
|
||||||
|
elif proxy_data[0].get('value') == '2':
|
||||||
|
line = proxy_data[1].get('preferenceName')
|
||||||
|
|
||||||
|
self.write_file(proxy_full_path, line)
|
||||||
self.execute_script(proxy_full_path)
|
self.execute_script(proxy_full_path)
|
||||||
else:
|
else:
|
||||||
self.logger.debug("Proxy preferences files is empty!!")
|
self.logger.debug("Proxy preferences files is empty!!")
|
||||||
|
|
Loading…
Reference in a new issue