Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 797 Vote(s) - 3.56 Average
  • 1
  • 2
  • 3
  • 4
  • 5
windows chrome refresh tab 0(or current tab) via command line

#1
I'm trying to do it with `python`, `webbrowser` module. But it does not have `Chromium`-specific functions. Is there another way? probably with a batch script?
Reply

#2
I use this myself: (I wrote is quickly as it was only for personal use). With a lot of clean up you might be able to get what you want. See

[To see links please register here]


import urllib2
import urllib
import os
import subprocess
import json

from websocket import create_connection

def refresh_page(url):
data = json.load(urllib2.urlopen('http://localhost:9222/json'))

found_page = False
for page in data:
if page['url'].lower() == url.lower():
found_page = True
websocketURL = page['webSocketDebuggerUrl']
ws = create_connection(websocketURL)

obj = { "id": 0,
"method": "Page.reload",
"params":
{
"ignoreCache": True,
"scriptToEvaluateOnLoad": ""
}
}

dev_request = json.dumps(obj)
ws.send(dev_request)
result = ws.recv()
ws.close()
if not found_page:
raise Exception("No pageFound")

def open_or_refresh(file_name):
file_name = "".join ( [f if f in r'\/:*?"<>|' else urllib.quote(f) for f in file_name] )
file_name = 'file:///' + file_name.replace('\\', '/')
file_name = file_name.encode('ascii', 'ignore')
try:
refresh_page(file_name)
except:
cmd = (r'"%(LOCALAPPDATA)s\Google\Chrome\Application\chrome.exe"'%os.environ
+ r' --remote-debugging-port=9222 "%s"' % file_name)
subprocess.Popen(cmd)

open_or_refresh(r"C:\test.html")
open_or_refresh(r"C:\test.html")
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through