Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
The joy of Native Messaging
Search
unvalley
July 28, 2026
200
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
The joy of Native Messaging
2026/7/27 雑LT
unvalley
July 28, 2026
Transcript
9 slides
Native Messagingの嬉しさ 雑LT @unvalley_ 1
Native Messaging - 「ユーザーのマシン上のアプリ」と「ブラウザ拡張」の間で、 メッセージ交換を可能にする技術 - 結構古くて、Chromeでは10年以上前から存在する Native App 他
2
(このLTでの)Native Messagingの嬉しさ ネイティブアプリ(特にLocal-First App)に ブラウザのコンテキストを与えられる 3
背景:内部リンク中心のドキュメントアプリをSwiftで作りたい で作りたい 4
欲しい機能:ウェブ上の記事をナレッジにしたい Native Messagingでいけそう 5
Webページ → Markdownにして加工 → ネイティブアプリ 1. 2. 3. ブラウザ拡張:@mozilla/readabilityで記事内容を抽出、.html→ .md化する
ブラウザ拡張からネイティブアプリ:Native Messagingでメッセージ送信 ネイティブアプリ:得られた .mdに対して内部リンクを適用。完了を返信 6
Native Messagingを使うときにやること 1. ブラウザ拡張:マニフェストの準備 - manifest.json に nativeMessaging権限を追加 2. ネイティブアプリ:アプリマニフェストのインストール
- ネイティブアプリを使える状態にして、アプリマニフェストを作成し1との 接続設定を書いて、OSごとの決められた場所に配置 3. ブラウザ拡張+ネイティブアプリ:メッセージ処理実装 - 拡張は sendNativeMessage などでJSONを送り、ネイティブアプリ はstdinでJSONを読みstdoutでレスポンスを返す 7
なぜこのケースでNative Messagingが必要なの? - Downloads APIやFile System Access APIでは、ネイティブアプリの処 理を挟めない -
localhostでもできるが、ポート管理やlocalサーバー常時起動が必要 8
Native Messagingはブラウザとネイティブアプリ間で色々できる セキュリティ(他人の実装) には気をつけながら楽しく使おう 終 9
More Decks by unvalley
See All by unvalley
Plugin System in Rust based JavaScript / TypeScript Linters
unvalley
6
2.6k
Exploring ways to stay continuously involved with OSS
unvalley
3
4.1k
Building An Ephemeral Markdown Paper with AI
unvalley
3
1.3k
Thoughts and experiences on Rust and TypeScript
unvalley
2
490
Exploring Type-Informed Lint Rules in Rust based TypeScript Linters
unvalley
7
13k
Behind VS Code Extensions for JavaScript / TypeScript Linting and Formatting
unvalley
7
3.9k
Behind Biome
unvalley
11
4.9k
Biome is for JavaScripters
unvalley
4
1.2k
Better Unit Testing
unvalley
1
830
Featured
See All Featured
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
2
4.1k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.2k
Documentation Writing (for coders)
carmenintech
77
5.7k
The Art of Programming - Codeland 2020
erikaheidi
57
15k
ラッコキーワード サービス紹介資料
rakko
5
6.1M
Reality Check: Gamification 10 Years Later
codingconduct
0
2.4k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
23k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Paper Plane
katiecoart
PRO
6
55k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
1k
Statistics for Hackers
jakevdp
799
230k