update
Some checks failed
Build Gurty / Build Gurty (, ubuntu-latest, linux, x86_64-unknown-linux-gnu) (push) Failing after 1m33s
Build GurtCA / Build GurtCA (, ubuntu-latest, linux, x86_64-unknown-linux-gnu) (push) Failing after 11m20s
Build GDExtension / Build GDExtension (libgurt_godot.so, ubuntu-latest, linux, x86_64-unknown-linux-gnu) (push) Failing after 16m9s
Build Flumi / Build Flumi (Linux, 4.4.1, ubuntu-latest, linux) (push) Failing after 2h10m11s
Build Flumi / Build Flumi (Windows Desktop, 4.4.1, windows-latest, windows) (push) Has been cancelled
Build GDExtension / Build GDExtension (gurt_godot.dll, windows-latest, windows, x86_64-pc-windows-msvc) (push) Has been cancelled
Build GurtCA / Build GurtCA (.exe, windows-latest, windows, x86_64-pc-windows-msvc) (push) Has been cancelled
Build Gurty / Build Gurty (.exe, windows-latest, windows, x86_64-pc-windows-msvc) (push) Has been cancelled

This commit is contained in:
2025-11-06 20:02:53 +08:00
parent 3f79614850
commit a508e3cefd
48 changed files with 136 additions and 137 deletions

View File

@@ -435,7 +435,7 @@ text = "Flumi"
layout_mode = 2
theme = ExtResource("2_theme")
theme_override_colors/font_color = Color(0.7, 0.7, 0.7, 1)
text = "Flumi is the official browser for the Gurted ecosystem, built using the Godot game engine. It provides a complete web browsing experience for gurt:// URLs with custom HTML/CSS rendering, Lua scripting support, and integration with the Gurted DNS system."
text = "Flumi is the official browser for the Gurted ecosystem, built using the Godot game engine. It provides a complete web browsing experience for lw:// URLs with custom HTML/CSS rendering, Lua scripting support, and integration with the Gurted DNS system."
autowrap_mode = 3
[node name="ProtocolPanel" type="VBoxContainer" parent="HSplitContainer/Content/ScrollContainer/ContentStack"]
@@ -463,7 +463,7 @@ layout_mode = 2
theme = ExtResource("2_theme")
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_font_sizes/font_size = 20
text = "gurt://"
text = "lw://"
[node name="DescriptionLabel" type="Label" parent="HSplitContainer/Content/ScrollContainer/ContentStack/ProtocolPanel/ProtocolSection/VBoxContainer"]
layout_mode = 2
@@ -503,5 +503,5 @@ text = "Luau Integration"
layout_mode = 2
theme = ExtResource("2_theme")
theme_override_colors/font_color = Color(0.7, 0.7, 0.7, 1)
text = "Flumi uses Luau (Lua) for client-side scripting, providing dynamic content manipulation and interactive experiences within gurt:// pages. Similar to how HTTP web browsers user JavaScript."
text = "Flumi uses Luau (Lua) for client-side scripting, providing dynamic content manipulation and interactive experiences within lw:// pages. Similar to how HTTP web browsers user JavaScript."
autowrap_mode = 3

View File

@@ -421,8 +421,8 @@ text = "默认搜索引擎地址: "
layout_mode = 2
size_flags_horizontal = 3
theme_override_styles/normal = SubResource("StyleBoxFlat_input")
text = "gurt://search.web?q="
placeholder_text = "gurt://search.web?q="
text = "lw://search.web?q="
placeholder_text = "lw://search.web?q="
[node name="PrivacyPanel" type="VBoxContainer" parent="HSplitContainer/Content/ScrollContainer/ContentStack"]
visible = false

View File

@@ -84,7 +84,7 @@ func _start_download(download_id: String, url: String, save_path: String, downlo
"current_site": download_data.get("current_site", "")
}
if url.begins_with("gurt://"):
if url.begins_with("lw://"):
_start_gurt_download(download_id, url)
else:
_start_http_download(download_id, url)

View File

@@ -14,7 +14,7 @@ static func set_dns_server(ip_port: String):
DNS_SERVER_PORT = 4878
static func is_gurt_domain(url: String) -> bool:
if url.begins_with("gurt://"):
if url.begins_with("lw://"):
return true
if not url.contains("://"):

View File

@@ -6,7 +6,7 @@ var settings_data = {
"startup_new_tab": true,
"startup_specific_page": false,
"startup_url": "",
"search_engine_url": "gurt://search.web?q=",
"search_engine_url": "lw://search.web?q=",
"download_confirmation": true,
"dns_url": "135.125.163.131:4878"
}

View File

@@ -198,7 +198,7 @@ func set_active_tab(index: int) -> void:
if tabs[index].has_content:
main.current_domain = tabs[index].current_url
var display_text = main.current_domain
if display_text.begins_with("gurt://"):
if display_text.begins_with("lw://"):
display_text = display_text.substr(7)
main.search_bar.text = display_text
else:

View File

@@ -40,7 +40,7 @@ static func get_or_create_gurt_client(domain: String) -> GurtProtocolClient:
static func extract_domain_from_url(gurt_url: String) -> String:
var host_domain = gurt_url
if host_domain.begins_with("gurt://"):
if host_domain.begins_with("lw://"):
host_domain = host_domain.right(-7)
var slash_pos = host_domain.find("/")
if slash_pos != -1:

View File

@@ -40,7 +40,6 @@ var HTML_CONTENT = """
<title>新标签页</title>
</head>
<body style="bg-[#323949] text-white font-sans">
<postprocess preset="crt"></postprocess>
<div style="flex flex-col items-center justify-center w-full mt-12">
<h1 style="target text-8xl font-bold mb-4 text-[#4a9eff] font-serif font-italic">你好!</h1>
<p style="text-lg mb-8 text-[#cccccc]">欢迎使用LeonBrowser</p>

View File

@@ -27,7 +27,7 @@ static func load_font(font_info: Dictionary) -> void:
if src.begins_with("http://") or src.begins_with("https://"):
load_web_font(font_info)
elif src.begins_with("gurt://"):
elif src.begins_with("lw://"):
load_gurt_font(font_info)
else:
load_local_font(font_info)

View File

@@ -20,7 +20,7 @@ func fetch_image(url: String) -> ImageTexture:
var headers: PackedStringArray
var response_headers = {}
if url.begins_with("gurt://"):
if url.begins_with("lw://"):
var gurt_body = await fetch_gurt_resource(url, true)
if gurt_body.is_empty():
return null
@@ -160,7 +160,7 @@ func fetch_external_resource(url: String, base_url: String = "") -> String:
if resolved_url.begins_with("https://"):
return await fetch_text(resolved_url)
elif resolved_url.begins_with("gurt://"):
elif resolved_url.begins_with("lw://"):
return fetch_gurt_resource(resolved_url)
else:
print("Resource loading error: Only HTTPS and GURT protocols are supported. Attempted: ", resolved_url)
@@ -171,8 +171,8 @@ func fetch_gurt_resource(url: String, as_binary: bool = false):
return PackedByteArray() if as_binary else ""
var gurt_url = url
if not gurt_url.begins_with("gurt://"):
gurt_url = "gurt://" + gurt_url
if not gurt_url.begins_with("lw://"):
gurt_url = "lw://" + gurt_url
if gurt_url.contains("localhost"):
gurt_url = gurt_url.replace("localhost", "127.0.0.1")

View File

@@ -102,19 +102,19 @@ func load_audio_async(src: String) -> void:
reset_stream_state()
if src.begins_with("https://") or src.begins_with("gurt://"):
if src.begins_with("https://") or src.begins_with("lw://"):
await load_remote_audio(src)
else:
print("Audio loading error: Only HTTPS and GURT protocols are supported. Attempted: ", src)
return
func load_remote_audio(src: String) -> void:
if not (src.begins_with("https://") or src.begins_with("gurt://")):
if not (src.begins_with("https://") or src.begins_with("lw://")):
return
if src.begins_with("https://"):
await load_https_audio(src)
elif src.begins_with("gurt://"):
elif src.begins_with("lw://"):
await load_gurt_audio(src)
func load_https_audio(src: String) -> void:

View File

@@ -79,7 +79,7 @@ static func get_current_domain() -> String:
static func sanitize_domain_for_filename(domain: String) -> String:
# Remove protocol prefix
if domain.begins_with("gurt://"):
if domain.begins_with("lw://"):
domain = domain.substr(7)
elif domain.contains("://"):
var parts = domain.split("://")

View File

@@ -12,7 +12,7 @@ static func setup_network_api(vm: LuauVM):
vm.lua_setglobal("fetch")
static func resolve_fetch_url(url: String) -> String:
if url.begins_with("http://") or url.begins_with("https://") or url.begins_with("gurt://"):
if url.begins_with("http://") or url.begins_with("https://") or url.begins_with("lw://"):
return url
var main_node = Engine.get_main_loop().current_scene
@@ -22,9 +22,9 @@ static func resolve_fetch_url(url: String) -> String:
if current_domain.is_empty():
if url.begins_with("/"):
return "gurt://" + url.substr(1)
return "lw://" + url.substr(1)
else:
return "gurt://" + url
return "lw://" + url
return URLUtils.resolve_url(current_domain, url)
@@ -35,7 +35,7 @@ static func _lua_fetch_handler(vm: LuauVM) -> int:
if vm.lua_gettop() >= 2 and vm.lua_istable(2):
options = vm.lua_todictionary(2)
# Resolve relative URLs and default to gurt:// protocol
# Resolve relative URLs and default to lw:// protocol
var url = resolve_fetch_url(original_url)
# Default options
@@ -135,7 +135,7 @@ static func _response_ok_handler(vm: LuauVM) -> int:
return 1
static func make_http_request(url: String, method: String, headers: PackedStringArray, body: String) -> Dictionary:
if url.begins_with("gurt://"):
if url.begins_with("lw://"):
return make_gurt_request(url, method, headers, body)
var http_client = HTTPClient.new()
var response_data = {
@@ -320,7 +320,7 @@ static func make_gurt_request(url: String, method: String, headers: PackedString
"body": ""
}
var domain_part = url.replace("gurt://", "")
var domain_part = url.replace("lw://", "")
if domain_part.contains("/"):
domain_part = domain_part.split("/")[0]

View File

@@ -3,7 +3,7 @@ extends RefCounted
static func resolve_url(base_url: String, relative_url: String) -> String:
# If relative_url is already absolute, return it as-is
if relative_url.begins_with("http://") or relative_url.begins_with("https://") or relative_url.begins_with("gurt://") or relative_url.begins_with("file://"):
if relative_url.begins_with("http://") or relative_url.begins_with("https://") or relative_url.begins_with("lw://") or relative_url.begins_with("file://"):
return relative_url
# If empty, treat as relative to current domain
@@ -94,7 +94,7 @@ static func extract_domain(url: String) -> String:
return ""
var clean_url = url
if clean_url.begins_with("gurt://"):
if clean_url.begins_with("lw://"):
clean_url = clean_url.substr(7)
elif clean_url.begins_with("https://"):
clean_url = clean_url.substr(8)

View File

@@ -120,8 +120,8 @@ func _on_search_submitted(url: String, add_to_history: bool = true) -> void:
tab.start_loading()
var gurt_url = url
if not gurt_url.begins_with("gurt://"):
gurt_url = "gurt://" + gurt_url
if not gurt_url.begins_with("lw://"):
gurt_url = "lw://" + gurt_url
await fetch_gurt_content_async(gurt_url, tab, url, add_to_history)
else:
@@ -289,7 +289,7 @@ func _on_search_focus_entered() -> void:
func _on_search_focus_exited() -> void:
if not current_domain.is_empty():
var display_text = current_domain
if display_text.begins_with("gurt://"):
if display_text.begins_with("lw://"):
display_text = display_text.right(-7)
elif display_text.begins_with("file://"):
display_text = URLUtils.file_url_to_path(display_text)
@@ -828,7 +828,7 @@ func reload_current_page() -> void:
_on_search_submitted(current_domain)
func navigate_to_url(url: String, add_to_history: bool = true) -> void:
if url.begins_with("gurt://") or url.begins_with("file://"):
if url.begins_with("lw://") or url.begins_with("file://"):
_on_search_submitted(url, add_to_history)
else:
var resolved_url = resolve_url(url)
@@ -837,7 +837,7 @@ func navigate_to_url(url: String, add_to_history: bool = true) -> void:
func update_search_bar_from_current_domain() -> void:
if not search_bar.has_focus() and not current_domain.is_empty():
var display_text = current_domain
if display_text.begins_with("gurt://"):
if display_text.begins_with("lw://"):
display_text = display_text.right(-7)
elif display_text.begins_with("file://"):
display_text = URLUtils.file_url_to_path(display_text)
@@ -878,7 +878,7 @@ func add_to_history(url: String, tab: Tab, add_to_navigation: bool = true):
icon_url = tab.get_meta("parsed_icon_url")
var clean_url = url
if clean_url.begins_with("gurt://"):
if clean_url.begins_with("lw://"):
clean_url = clean_url.right(-7)
BrowserHistory.add_entry(clean_url, title, icon_url)
@@ -922,7 +922,7 @@ func get_startup_behavior() -> Dictionary:
func _handle_startup_behavior():
var args = OS.get_cmdline_args()
for arg in args:
if arg.begins_with("gurt://"):
if arg.begins_with("lw://"):
print("Opening URL from command line: ", arg)
_on_search_submitted(arg, true)
return