Skip to content

Commit

Permalink
Update Pro5Chrome.py
Browse files Browse the repository at this point in the history
  • Loading branch information
hieuck committed Jul 2, 2024
1 parent d607131 commit bdb5f45
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions Pro5Chrome.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,23 @@ def open_all_chrome_profiles():
profile_directory = f"--profile-directory=Profile {profile}"
subprocess.Popen([chrome_path, profile_directory])

# Hàm để mở URL với toàn bộ Chrome profiles
def open_url_all_profiles():
chrome_path = chrome_var.get() or read_chrome_path() or default_chrome_path

if not profiles:
print("Không có profile nào để mở.")
return

selected_url_index = urls_listbox.curselection()
if selected_url_index:
selected_url = urls_listbox.get(selected_url_index[0])
for profile in profiles:
profile_directory = f"--profile-directory=Profile {profile}"
subprocess.Popen([chrome_path, profile_directory, selected_url])
else:
print("Vui lòng chọn một URL từ danh sách")

# Hàm để xử lý khi nhấn Enter trên Combobox để mở Chrome
def open_chrome_on_enter(event=None):
if event and event.keysym == 'Return':
Expand Down Expand Up @@ -393,14 +410,18 @@ def delete_selected_urls():
open_url_button = ttk.Button(open_delete_frame, text="Mở URL được chọn", command=open_url_from_listbox)
open_url_button.pack(side=tk.LEFT, padx=5, pady=10)

# Nút để xóa danh sách URLs
delete_urls_button = ttk.Button(open_delete_frame, text="Xóa danh sách URLs", command=clear_urls_list)
delete_urls_button.pack(side=tk.LEFT, padx=5, pady=10)

# Nút để xóa URL từ Listbox
delete_url_button = ttk.Button(url_buttons_frame, text="Xóa URL được chọn", command=delete_selected_urls)
delete_url_button = ttk.Button(open_delete_frame, text="Xóa URL được chọn", command=delete_selected_urls)
delete_url_button.pack(side=tk.LEFT, padx=5, pady=10)

# Nút để mở URL với toàn bộ profile
open_all_profiles_button = ttk.Button(url_buttons_frame, text="Mở URL với Toàn Bộ Profiles", command=open_url_all_profiles)
open_all_profiles_button.pack(side=tk.LEFT, padx=5, pady=10)

# Nút để xóa danh sách URLs
delete_urls_button = ttk.Button(url_buttons_frame, text="Xóa danh sách URLs", command=clear_urls_list)
delete_urls_button.pack(side=tk.LEFT, padx=5, pady=10)

# ----------------------------------
# Nút để mở các tệp profiles.js, config.js và URL.js
# ----------------------------------
Expand Down

0 comments on commit bdb5f45

Please sign in to comment.