phase: 20.49 COMPLETE; 20.50 Flow+String minimal reps; 20.51 selfhost v0/v1 minimal (Option A/B); hv1-inline binop/unop/copy; docs + run_all + CURRENT_TASK -> 21.0
This commit is contained in:
@ -14,15 +14,15 @@ Nyashでブラウザーを作り、ネイティブ実行する構想について
|
||||
{
|
||||
"name": "Nyash Browser Extension",
|
||||
"permissions": ["webRequest", "webRequestBlocking", "nativeMessaging"],
|
||||
"host_permissions": ["*://*/*.nyash"]
|
||||
"host_permissions": ["*://*/*.hako"]
|
||||
}
|
||||
|
||||
// background.js
|
||||
chrome.webRequest.onBeforeRequest.addListener(
|
||||
(details) => {
|
||||
if (details.url.endsWith('.nyash')) {
|
||||
if (details.url.endsWith('.hako')) {
|
||||
// Native hostと通信してNyash VMで実行
|
||||
chrome.runtime.sendNativeMessage('com.nyash.runtime',
|
||||
chrome.runtime.sendNativeMessage('com.hako.runtime',
|
||||
{ command: 'execute', url: details.url },
|
||||
(response) => {
|
||||
// 結果を新しいタブで表示
|
||||
@ -99,8 +99,8 @@ async fn execute_nyash(window: Window, code: String) -> Result<Value, String> {
|
||||
fn nyash_protocol_handler(app: &AppHandle, request: &Request) -> Response {
|
||||
let path = request.uri().path();
|
||||
|
||||
// .nyashファイルを実行
|
||||
if path.ends_with(".nyash") {
|
||||
// .hakoファイルを実行
|
||||
if path.ends_with(".hako") {
|
||||
let code = std::fs::read_to_string(path).unwrap();
|
||||
let vm = VM::new();
|
||||
let result = vm.execute(&code).unwrap();
|
||||
@ -124,7 +124,7 @@ fn nyash_protocol_handler(app: &AppHandle, request: &Request) -> Response {
|
||||
#### 1. カスタムHTMLエレメント
|
||||
```html
|
||||
<!-- Nyashコードを直接HTMLに埋め込み -->
|
||||
<nyash-app src="todo-app.nyash">
|
||||
<nyash-app src="todo-app.hako">
|
||||
<template>
|
||||
<div class="todo-list">
|
||||
<nyash-for items="todos" as="todo">
|
||||
@ -423,7 +423,7 @@ impl eframe::App for NyashBrowser {
|
||||
|
||||
2. **Week 2**: カスタムプロトコル
|
||||
- nyash://プロトコルハンドラー
|
||||
- .nyashファイル実行
|
||||
- .hakoファイル実行
|
||||
- 結果表示
|
||||
|
||||
3. **Week 3**: 高速化
|
||||
|
||||
Reference in New Issue
Block a user