VertexEngine-WebEngine 1.2rc2__tar.gz → 1.2rc4__tar.gz
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.
- {vertexengine_webengine-1.2rc2 → vertexengine_webengine-1.2rc4}/PKG-INFO +9 -3
- {vertexengine_webengine-1.2rc2 → vertexengine_webengine-1.2rc4}/README.md +6 -1
- {vertexengine_webengine-1.2rc2 → vertexengine_webengine-1.2rc4}/pyproject.toml +3 -2
- vertexengine_webengine-1.2rc4/src/VertexEngine/VertexWebEngineCore/AssetManager.py +36 -0
- vertexengine_webengine-1.2rc4/src/VertexEngine/VertexWebEngineCore/WebEngineURLInterceptor.py +12 -0
- vertexengine_webengine-1.2rc4/src/VertexEngine/VertexWebEngineCore/WebPage.py +9 -0
- vertexengine_webengine-1.2rc4/src/VertexEngine/VertexWebEngineCore/WebProfile.py +14 -0
- vertexengine_webengine-1.2rc4/src/VertexEngine/VertexWebEngineWidgets/EngineView.py +70 -0
- vertexengine_webengine-1.2rc4/src/VertexEngine/WebBrowserSystem/BrowserToolBar.py +39 -0
- vertexengine_webengine-1.2rc4/src/VertexEngine/WebBrowserSystem/downloads.py +14 -0
- {vertexengine_webengine-1.2rc2 → vertexengine_webengine-1.2rc4}/src/VertexEngine_WebEngine.egg-info/PKG-INFO +9 -3
- {vertexengine_webengine-1.2rc2 → vertexengine_webengine-1.2rc4}/src/VertexEngine_WebEngine.egg-info/SOURCES.txt +6 -0
- vertexengine_webengine-1.2rc2/src/VertexEngine/VertexWebEngineWidgets/EngineView.py +0 -23
- {vertexengine_webengine-1.2rc2 → vertexengine_webengine-1.2rc4}/LICENSE +0 -0
- {vertexengine_webengine-1.2rc2 → vertexengine_webengine-1.2rc4}/setup.cfg +0 -0
- {vertexengine_webengine-1.2rc2 → vertexengine_webengine-1.2rc4}/src/VertexEngine/VertexWebEngineCore/JSBridge.py +0 -0
- {vertexengine_webengine-1.2rc2 → vertexengine_webengine-1.2rc4}/src/VertexEngine/VertexWebEngineCore/WebScene.py +0 -0
- {vertexengine_webengine-1.2rc2 → vertexengine_webengine-1.2rc4}/src/VertexEngine_WebEngine.egg-info/dependency_links.txt +0 -0
- {vertexengine_webengine-1.2rc2 → vertexengine_webengine-1.2rc4}/src/VertexEngine_WebEngine.egg-info/requires.txt +0 -0
- {vertexengine_webengine-1.2rc2 → vertexengine_webengine-1.2rc4}/src/VertexEngine_WebEngine.egg-info/top_level.txt +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: VertexEngine-WebEngine
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2rc4
|
|
4
4
|
Summary: The offical WebEngine Extension of the VertexEngine SDK.
|
|
5
5
|
Author-email: Tyrel Miguel <annbasilan0828@gmail.com>
|
|
6
6
|
License: MIT
|
|
7
7
|
Project-URL: Documentation, https://vertexenginedocs.netlify.app/
|
|
8
|
-
Project-URL:
|
|
8
|
+
Project-URL: Source, https://github.com/VertexEngine-Projects/VertexEngine-WebEngine-Code
|
|
9
|
+
Project-URL: Issues, https://github.com/VertexEngine-Projects/VertexEngine-WebEngine-Code/issues
|
|
9
10
|
Requires-Python: >=3.10
|
|
10
11
|
Description-Content-Type: text/markdown
|
|
11
12
|
License-File: LICENSE
|
|
@@ -22,7 +23,12 @@ VertexEngine-WebEngine is a WebEngine built for the VertexEngine SDK. It's a sep
|
|
|
22
23
|
The documentation is in the following link:
|
|
23
24
|
[Project Documentation](https://vertexenginedocs.netlify.app/) for help.
|
|
24
25
|
|
|
25
|
-
## Change Logs (1.
|
|
26
|
+
## Change Logs (1.2rc4), NEW!
|
|
27
|
+
### 1.4rc4
|
|
28
|
+
- REFINING AGAIN! Docs on v1.2.0
|
|
29
|
+
- Source Link on github
|
|
30
|
+
### 1.2rc3
|
|
31
|
+
- FULL REFINATION OF THE BROWSER! Documentation Updated.
|
|
26
32
|
### 1.2rc2
|
|
27
33
|
- EXPANDED JS BRIDGE!
|
|
28
34
|
### 1.2rc1
|
|
@@ -5,7 +5,12 @@ VertexEngine-WebEngine is a WebEngine built for the VertexEngine SDK. It's a sep
|
|
|
5
5
|
The documentation is in the following link:
|
|
6
6
|
[Project Documentation](https://vertexenginedocs.netlify.app/) for help.
|
|
7
7
|
|
|
8
|
-
## Change Logs (1.
|
|
8
|
+
## Change Logs (1.2rc4), NEW!
|
|
9
|
+
### 1.4rc4
|
|
10
|
+
- REFINING AGAIN! Docs on v1.2.0
|
|
11
|
+
- Source Link on github
|
|
12
|
+
### 1.2rc3
|
|
13
|
+
- FULL REFINATION OF THE BROWSER! Documentation Updated.
|
|
9
14
|
### 1.2rc2
|
|
10
15
|
- EXPANDED JS BRIDGE!
|
|
11
16
|
### 1.2rc1
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "VertexEngine-WebEngine"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.2rc4"
|
|
8
8
|
description = "The offical WebEngine Extension of the VertexEngine SDK."
|
|
9
9
|
authors = [
|
|
10
10
|
{ name="Tyrel Miguel", email="annbasilan0828@gmail.com" }
|
|
@@ -25,4 +25,5 @@ where = ["src"]
|
|
|
25
25
|
|
|
26
26
|
[project.urls]
|
|
27
27
|
Documentation = "https://vertexenginedocs.netlify.app/"
|
|
28
|
-
|
|
28
|
+
Source = "https://github.com/VertexEngine-Projects/VertexEngine-WebEngine-Code"
|
|
29
|
+
Issues = "https://github.com/VertexEngine-Projects/VertexEngine-WebEngine-Code/issues"
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from PyQt6.QtGui import QPixmap
|
|
3
|
+
|
|
4
|
+
class AssetManager:
|
|
5
|
+
def __init__(self, base_path="assets"):
|
|
6
|
+
"""
|
|
7
|
+
Base directory for assets (images, icons, etc.)
|
|
8
|
+
"""
|
|
9
|
+
self.base_path = base_path
|
|
10
|
+
self.cache = {} # Cache loaded images for speed
|
|
11
|
+
os.makedirs(self.base_path, exist_ok=True)
|
|
12
|
+
|
|
13
|
+
def load_image(self, path: str) -> QPixmap:
|
|
14
|
+
"""
|
|
15
|
+
Load an image from the assets folder, cache it
|
|
16
|
+
"""
|
|
17
|
+
full_path = os.path.join(self.base_path, path)
|
|
18
|
+
|
|
19
|
+
if full_path in self.cache:
|
|
20
|
+
return self.cache[full_path]
|
|
21
|
+
|
|
22
|
+
if not os.path.isfile(full_path):
|
|
23
|
+
print(f"⚠️ Asset not found: {full_path}")
|
|
24
|
+
return QPixmap() # Return empty pixmap if missing
|
|
25
|
+
|
|
26
|
+
pixmap = QPixmap(full_path)
|
|
27
|
+
self.cache[full_path] = pixmap
|
|
28
|
+
print(f"🖼 Loaded image: {path}")
|
|
29
|
+
return pixmap
|
|
30
|
+
|
|
31
|
+
def clear_cache(self):
|
|
32
|
+
"""
|
|
33
|
+
Clear cached assets (useful if assets change dynamically)
|
|
34
|
+
"""
|
|
35
|
+
self.cache.clear()
|
|
36
|
+
print("🗑 Asset cache cleared")
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from PyQt6.QtWebEngineCore import QWebEngineUrlRequestInterceptor
|
|
2
|
+
|
|
3
|
+
class VertexInterceptor(QWebEngineUrlRequestInterceptor):
|
|
4
|
+
def interceptRequest(self, info):
|
|
5
|
+
url = info.requestUrl().toString()
|
|
6
|
+
|
|
7
|
+
# Block ads/tracking
|
|
8
|
+
blocked_words = ["ads", "doubleclick", "tracker"]
|
|
9
|
+
|
|
10
|
+
if any(word in url for word in blocked_words):
|
|
11
|
+
print("🚫 Blocked:", url)
|
|
12
|
+
info.block(True)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
from PyQt6.QtWebEngineCore import QWebEnginePage
|
|
2
|
+
|
|
3
|
+
class VertexWebPage(QWebEnginePage):
|
|
4
|
+
def javaScriptConsoleMessage(self, level, message, line, source):
|
|
5
|
+
print(f"[JS Console] {message} (Line {line})")
|
|
6
|
+
|
|
7
|
+
def acceptNavigationRequest(self, url, nav_type, isMainFrame):
|
|
8
|
+
print("Navigating to:", url.toString())
|
|
9
|
+
return True
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
from PyQt6.QtWebEngineCore import QWebEngineProfile
|
|
2
|
+
|
|
3
|
+
class VertexProfile(QWebEngineProfile):
|
|
4
|
+
def __init__(self, name="None"):
|
|
5
|
+
super().__init__(name)
|
|
6
|
+
|
|
7
|
+
self.setPersistentCookiesPolicy(
|
|
8
|
+
QWebEngineProfile.PersistentCookiesPolicy.ForcePersistentCookies
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
self.setCachePath("cache/")
|
|
12
|
+
self.setPersistentStoragePath("storage/")
|
|
13
|
+
|
|
14
|
+
print("Profile Loaded ✅")
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
from PyQt6.QtWebEngineWidgets import QWebEngineView
|
|
2
|
+
from PyQt6.QtWebChannel import QWebChannel
|
|
3
|
+
from PyQt6.QtWebEngineCore import QWebEngineProfile
|
|
4
|
+
from VertexWebEngineCore.WebScene import SceneManager
|
|
5
|
+
from VertexWebEngineCore.JSBridge import JSBridge
|
|
6
|
+
from VertexWebEngineCore.WebPage import VertexWebPage
|
|
7
|
+
from VertexWebEngineCore.WebEngineURLInterceptor import VertexInterceptor
|
|
8
|
+
# -----------------------------
|
|
9
|
+
# Download Manager
|
|
10
|
+
# -----------------------------
|
|
11
|
+
class DownloadManager:
|
|
12
|
+
def __init__(self):
|
|
13
|
+
self.download_folder = "downloads/"
|
|
14
|
+
|
|
15
|
+
def handle_download(self, download):
|
|
16
|
+
download.setDownloadDirectory(self.download_folder)
|
|
17
|
+
download.accept()
|
|
18
|
+
print("📥 Downloading:", download.downloadFileName())
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
# -----------------------------
|
|
22
|
+
# WebEngine
|
|
23
|
+
# -----------------------------
|
|
24
|
+
class WebEngine(QWebEngineView):
|
|
25
|
+
def __init__(self):
|
|
26
|
+
super().__init__()
|
|
27
|
+
|
|
28
|
+
print("🔥 WebEngine Starting...")
|
|
29
|
+
|
|
30
|
+
# Scene Manager + JS Bridge
|
|
31
|
+
self.scene_manager = SceneManager(self)
|
|
32
|
+
self.bridge = JSBridge(self.scene_manager)
|
|
33
|
+
|
|
34
|
+
# Web Channel
|
|
35
|
+
self.channel = QWebChannel()
|
|
36
|
+
self.channel.registerObject("bridge", self.bridge)
|
|
37
|
+
|
|
38
|
+
# -----------------------------
|
|
39
|
+
# Profile
|
|
40
|
+
# -----------------------------
|
|
41
|
+
self.profile = QWebEngineProfile("VertexProfile")
|
|
42
|
+
self.profile.setPersistentStoragePath("storage/")
|
|
43
|
+
self.profile.setCachePath("cache/")
|
|
44
|
+
|
|
45
|
+
# Interceptor
|
|
46
|
+
self.interceptor = VertexInterceptor()
|
|
47
|
+
self.profile.setUrlRequestInterceptor(self.interceptor)
|
|
48
|
+
|
|
49
|
+
# Downloads
|
|
50
|
+
self.download_manager = DownloadManager()
|
|
51
|
+
self.profile.downloadRequested.connect(
|
|
52
|
+
self.download_manager.handle_download
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
# -----------------------------
|
|
56
|
+
# Page (correct usage)
|
|
57
|
+
# -----------------------------
|
|
58
|
+
self.page_obj = VertexWebPage(self) # parent is the view
|
|
59
|
+
self.page_obj.setProfile(self.profile) # assign profile properly
|
|
60
|
+
self.setPage(self.page_obj)
|
|
61
|
+
|
|
62
|
+
# Assign WebChannel
|
|
63
|
+
self.page().setWebChannel(self.channel)
|
|
64
|
+
|
|
65
|
+
# -----------------------------
|
|
66
|
+
# Start on menu
|
|
67
|
+
# -----------------------------
|
|
68
|
+
self.scene_manager.load_scene("menu")
|
|
69
|
+
|
|
70
|
+
print("✅ WebEngine Ready!")
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
from PyQt6.QtWidgets import QToolBar, QLineEdit
|
|
2
|
+
from PyQt6.QtGui import QAction
|
|
3
|
+
|
|
4
|
+
class NavBar(QToolBar):
|
|
5
|
+
def __init__(self, tabs):
|
|
6
|
+
super().__init__()
|
|
7
|
+
|
|
8
|
+
self.tabs = tabs
|
|
9
|
+
|
|
10
|
+
# Buttons
|
|
11
|
+
back_btn = QAction("⬅", self)
|
|
12
|
+
forward_btn = QAction("➡", self)
|
|
13
|
+
reload_btn = QAction("🔄", self)
|
|
14
|
+
newtab_btn = QAction("➕", self)
|
|
15
|
+
|
|
16
|
+
back_btn.triggered.connect(lambda: self.current().back())
|
|
17
|
+
forward_btn.triggered.connect(lambda: self.current().forward())
|
|
18
|
+
reload_btn.triggered.connect(lambda: self.current().reload())
|
|
19
|
+
newtab_btn.triggered.connect(lambda: self.tabs.add_new_tab())
|
|
20
|
+
|
|
21
|
+
self.addAction(back_btn)
|
|
22
|
+
self.addAction(forward_btn)
|
|
23
|
+
self.addAction(reload_btn)
|
|
24
|
+
self.addAction(newtab_btn)
|
|
25
|
+
|
|
26
|
+
# URL Bar
|
|
27
|
+
self.url_bar = QLineEdit()
|
|
28
|
+
self.url_bar.returnPressed.connect(self.load_url)
|
|
29
|
+
self.addWidget(self.url_bar)
|
|
30
|
+
|
|
31
|
+
def current(self):
|
|
32
|
+
return self.tabs.currentWidget()
|
|
33
|
+
|
|
34
|
+
def load_url(self):
|
|
35
|
+
url = self.url_bar.text()
|
|
36
|
+
if not url.startswith("http"):
|
|
37
|
+
url = "https://" + url
|
|
38
|
+
|
|
39
|
+
self.current().load(url)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
class DownloadManager:
|
|
4
|
+
def __init__(self):
|
|
5
|
+
self.download_folder = "downloads/"
|
|
6
|
+
os.makedirs(self.download_folder, exist_ok=True)
|
|
7
|
+
|
|
8
|
+
def handle_download(self, download):
|
|
9
|
+
filename = download.downloadFileName()
|
|
10
|
+
|
|
11
|
+
download.setDownloadDirectory(self.download_folder)
|
|
12
|
+
download.accept()
|
|
13
|
+
|
|
14
|
+
print("📥 Downloading:", filename)
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: VertexEngine-WebEngine
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2rc4
|
|
4
4
|
Summary: The offical WebEngine Extension of the VertexEngine SDK.
|
|
5
5
|
Author-email: Tyrel Miguel <annbasilan0828@gmail.com>
|
|
6
6
|
License: MIT
|
|
7
7
|
Project-URL: Documentation, https://vertexenginedocs.netlify.app/
|
|
8
|
-
Project-URL:
|
|
8
|
+
Project-URL: Source, https://github.com/VertexEngine-Projects/VertexEngine-WebEngine-Code
|
|
9
|
+
Project-URL: Issues, https://github.com/VertexEngine-Projects/VertexEngine-WebEngine-Code/issues
|
|
9
10
|
Requires-Python: >=3.10
|
|
10
11
|
Description-Content-Type: text/markdown
|
|
11
12
|
License-File: LICENSE
|
|
@@ -22,7 +23,12 @@ VertexEngine-WebEngine is a WebEngine built for the VertexEngine SDK. It's a sep
|
|
|
22
23
|
The documentation is in the following link:
|
|
23
24
|
[Project Documentation](https://vertexenginedocs.netlify.app/) for help.
|
|
24
25
|
|
|
25
|
-
## Change Logs (1.
|
|
26
|
+
## Change Logs (1.2rc4), NEW!
|
|
27
|
+
### 1.4rc4
|
|
28
|
+
- REFINING AGAIN! Docs on v1.2.0
|
|
29
|
+
- Source Link on github
|
|
30
|
+
### 1.2rc3
|
|
31
|
+
- FULL REFINATION OF THE BROWSER! Documentation Updated.
|
|
26
32
|
### 1.2rc2
|
|
27
33
|
- EXPANDED JS BRIDGE!
|
|
28
34
|
### 1.2rc1
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
LICENSE
|
|
2
2
|
README.md
|
|
3
3
|
pyproject.toml
|
|
4
|
+
src/VertexEngine/VertexWebEngineCore/AssetManager.py
|
|
4
5
|
src/VertexEngine/VertexWebEngineCore/JSBridge.py
|
|
6
|
+
src/VertexEngine/VertexWebEngineCore/WebEngineURLInterceptor.py
|
|
7
|
+
src/VertexEngine/VertexWebEngineCore/WebPage.py
|
|
8
|
+
src/VertexEngine/VertexWebEngineCore/WebProfile.py
|
|
5
9
|
src/VertexEngine/VertexWebEngineCore/WebScene.py
|
|
6
10
|
src/VertexEngine/VertexWebEngineWidgets/EngineView.py
|
|
11
|
+
src/VertexEngine/WebBrowserSystem/BrowserToolBar.py
|
|
12
|
+
src/VertexEngine/WebBrowserSystem/downloads.py
|
|
7
13
|
src/VertexEngine_WebEngine.egg-info/PKG-INFO
|
|
8
14
|
src/VertexEngine_WebEngine.egg-info/SOURCES.txt
|
|
9
15
|
src/VertexEngine_WebEngine.egg-info/dependency_links.txt
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
from PyQt6.QtWebEngineWidgets import QWebEngineView
|
|
2
|
-
from PyQt6.QtWebChannel import QWebChannel
|
|
3
|
-
from VertexWebEngineCore.WebScene import SceneManager
|
|
4
|
-
from VertexWebEngineCore.JSBridge import JSBridge
|
|
5
|
-
|
|
6
|
-
class WebEngine(QWebEngineView):
|
|
7
|
-
def __init__(self):
|
|
8
|
-
super().__init__()
|
|
9
|
-
|
|
10
|
-
# Scene system
|
|
11
|
-
self.scene_manager = SceneManager(self)
|
|
12
|
-
|
|
13
|
-
# Bridge
|
|
14
|
-
self.bridge = JSBridge(self.scene_manager)
|
|
15
|
-
|
|
16
|
-
# Channel
|
|
17
|
-
self.channel = QWebChannel()
|
|
18
|
-
self.channel.registerObject("bridge", self.bridge)
|
|
19
|
-
|
|
20
|
-
self.page().setWebChannel(self.channel)
|
|
21
|
-
|
|
22
|
-
# Start on menu
|
|
23
|
-
self.scene_manager.load_scene("menu")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|