pyloid 0.20.1__py3-none-any.whl → 0.20.1.dev0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
pyloid/browser_window.py CHANGED
@@ -26,7 +26,8 @@ from PySide6.QtGui import QPixmap, QMovie
26
26
  from PySide6.QtWidgets import QSplashScreen, QLabel
27
27
  from PySide6.QtCore import QSize
28
28
  from typing import TYPE_CHECKING
29
- from PySide6.QtWebEngineCore import QWebEngineSettings
29
+ from PySide6.QtWebEngineCore import QWebEngineSettings, QWebEngineUrlRequestInterceptor
30
+ from .utils import get_production_path, is_production
30
31
 
31
32
  if TYPE_CHECKING:
32
33
  from ..pyloid import Pyloid
@@ -66,6 +67,26 @@ class CustomWebPage(QWebEnginePage):
66
67
  # """desktop media handler"""
67
68
  # self._desktop_media_handler = handler
68
69
 
70
+ class CustomInterceptor(QWebEngineUrlRequestInterceptor):
71
+ def __init__(self, index_path=None):
72
+ super().__init__()
73
+ self.index_path = get_production_path()
74
+ self.last_path = "/"
75
+
76
+ def interceptRequest(self, info):
77
+ url = info.requestUrl()
78
+ navigation_type = info.navigationType()
79
+
80
+ print("--------------------------------")
81
+
82
+ print(url)
83
+ print(url.scheme())
84
+ print(url.host())
85
+ print(url.url())
86
+ print(self.last_path)
87
+
88
+ self.last_path = url.path()
89
+
69
90
 
70
91
  class CustomWebEngineView(QWebEngineView):
71
92
  def __init__(self, parent: "BrowserWindow" = None):
@@ -391,6 +412,17 @@ class BrowserWindow:
391
412
 
392
413
  # Set F12 shortcut
393
414
  self.set_dev_tools(self.dev_tools)
415
+
416
+ # 프로필 가져오기 및 인터셉터 설정
417
+ profile = self.web_view.page().profile()
418
+
419
+ # # 기존 인터셉터가 있다면 제거
420
+ # if self.interceptor:
421
+ # profile.setUrlRequestInterceptor(None)
422
+
423
+ # 새 인터셉터 설정
424
+ self.interceptor = CustomInterceptor()
425
+ profile.setUrlRequestInterceptor(self.interceptor)
394
426
 
395
427
  def _on_load_finished(self, ok):
396
428
  """Handles the event when the web page finishes loading."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyloid
3
- Version: 0.20.1
3
+ Version: 0.20.1.dev0
4
4
  Summary:
5
5
  Author: aesthetics-of-record
6
6
  Author-email: 111675679+aesthetics-of-record@users.noreply.github.com
@@ -10,7 +10,6 @@ Classifier: Programming Language :: Python :: 3.9
10
10
  Classifier: Programming Language :: Python :: 3.10
11
11
  Classifier: Programming Language :: Python :: 3.11
12
12
  Classifier: Programming Language :: Python :: 3.12
13
- Requires-Dist: pyinstaller (>=6.11.1,<7.0.0)
14
13
  Requires-Dist: pyside6 (>=6.8.1,<7.0.0)
15
14
  Description-Content-Type: text/markdown
16
15
 
@@ -1,7 +1,7 @@
1
1
  pyloid/__init__.py,sha256=t1_67LkSfP4F1TYq4-62z5Cc3Gx1jyWI1yXux7Ojaug,484
2
2
  pyloid/api.py,sha256=A61Kmddh8BlpT3LfA6NbPQNzFmD95vQ4WKX53oKsGYU,2419
3
3
  pyloid/autostart.py,sha256=K7DQYl4LHItvPp0bt1V9WwaaZmVSTeGvadkcwG-KKrI,3899
4
- pyloid/browser_window.py,sha256=6Es-DH45URUV6rlCBWj3ZWwrXLMUvqp5700WlU8Sdwo,62984
4
+ pyloid/browser_window.py,sha256=Deq6kr5ZzQtL-ys46Y7GrwtP42KEGdnmmptnOlvrpLk,64080
5
5
  pyloid/builder/__init__.py,sha256=nw0r2RXqZ6eEbSbVF44sHD7NXovMShujxpTwygXXlrY,2889
6
6
  pyloid/builder/build_config.schema.json,sha256=Wj4_RCxXrQE9lq9Qxen1oy1Q0lhi2ojDkln8YX_LntM,2213
7
7
  pyloid/builder/spec.py,sha256=eTZ6b3ksysjH1mnorBtHFsMI7r9jGmCOJGcpJvNmY_E,6119
@@ -15,7 +15,7 @@ pyloid/thread_pool.py,sha256=fKOBb8jMfZn_7crA_fJCno8dObBRZE31EIWaNQ759aw,14616
15
15
  pyloid/timer.py,sha256=RqMsChFUd93cxMVgkHWiIKrci0QDTBgJSTULnAtYT8M,8712
16
16
  pyloid/tray.py,sha256=D12opVEc2wc2T4tK9epaN1oOdeziScsIVNM2uCN7C-A,1710
17
17
  pyloid/utils.py,sha256=mAjuppRXlZAocggf8La00Ae0Qzi4IRL_ovG87x4wagI,3300
18
- pyloid-0.20.1.dist-info/LICENSE,sha256=F96EzotgWhhpnQTW2TcdoqrMDir1jyEo6H915tGQ-QE,11524
19
- pyloid-0.20.1.dist-info/METADATA,sha256=R0OvvSUncz6VqS-vD_0zNJ_AYEBtpX75KFkqWS9rrqk,3056
20
- pyloid-0.20.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
21
- pyloid-0.20.1.dist-info/RECORD,,
18
+ pyloid-0.20.1.dev0.dist-info/LICENSE,sha256=F96EzotgWhhpnQTW2TcdoqrMDir1jyEo6H915tGQ-QE,11524
19
+ pyloid-0.20.1.dev0.dist-info/METADATA,sha256=nKIcakJzMy-Y2xa0QmE00uE9MCL1LbZ7USF5dudfAb0,3016
20
+ pyloid-0.20.1.dev0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
21
+ pyloid-0.20.1.dev0.dist-info/RECORD,,