Add platform-specific extension install paths

Enhanced extension installation documentation across docs, examples, and the generated install guide. Added Windows, macOS, and Linux-specific paths to help users find the correct installation directory. The dynamic README now shows the machine's actual extensions directory and typical OS paths. Also includes a minor fix removing wide string literal prefix from a path string.
This commit is contained in:
2026-07-14 10:13:32 +12:00
parent fbd8a555ec
commit e876e80bea
5 changed files with 23 additions and 4 deletions
+2
View File
@@ -169,6 +169,8 @@ Shared logic in `src/ui/paths.cpp` writes under:
| macOS | `~/Library/Application Support/Nebula/User Data` |
| Linux | `$XDG_DATA_HOME/Nebula/User Data` or `~/.local/share/Nebula/User Data` |
Unpacked extensions load from `<user data>/extensions/` on every OS (`GetExtensionsDirectory()`). Settings → Plugins shows the live path.
Platform-specific discovery lives in `src/platform/*/paths_*.cpp`.
## GPU / Chromium flags
+7 -2
View File
@@ -1,8 +1,13 @@
Copy this folder into Nebula's extensions directory to install:
%LOCALAPPDATA%\Nebula\User Data\extensions\hello-nebula\
Windows: %LOCALAPPDATA%\Nebula\User Data\extensions\hello-nebula\
macOS: ~/Library/Application Support/Nebula/User Data/extensions/hello-nebula/
Linux: ~/.local/share/Nebula/User Data/extensions/hello-nebula/
(or $XDG_DATA_HOME/Nebula/User Data/extensions/hello-nebula/)
Then open Settings > Plugins and click Reload Plugins (or restart Nebula).
Or open Settings > Plugins — the install path is shown there.
Then click Reload Plugins (or restart Nebula).
manifest.json fields:
id, name, version, description, enabled
@@ -20,7 +20,12 @@ Install
-------
Copy this folder to:
%LOCALAPPDATA%\Nebula\User Data\extensions\return-youtube-dislike\
Windows: %LOCALAPPDATA%\Nebula\User Data\extensions\return-youtube-dislike\
macOS: ~/Library/Application Support/Nebula/User Data/extensions/return-youtube-dislike/
Linux: ~/.local/share/Nebula/User Data/extensions/return-youtube-dislike/
(or $XDG_DATA_HOME/Nebula/User Data/extensions/return-youtube-dislike/)
Or open Settings > Plugins — the install path is shown there.
Open Settings > Plugins > Reload Plugins, then open a YouTube video.
+1 -1
View File
@@ -28,7 +28,7 @@ constexpr size_t kMaxSiteHistoryEntries = 200;
std::filesystem::path GetSiteHistoryPath() {
const auto user_data = nebula::ui::GetUserDataDirectory();
return user_data.empty() ? std::filesystem::path{} : user_data / L"site_history.txt";
return user_data.empty() ? std::filesystem::path{} : user_data / "site_history.txt";
}
std::string ToLowerAscii(std::string value) {
+7
View File
@@ -274,10 +274,17 @@ void WriteInstallReadme(const std::filesystem::path& extensions_dir) {
return;
}
const std::string dir_utf8 = nebula::platform::PathToUtf8(extensions_dir);
output << "Nebula Extensions\n"
<< "=================\n\n"
<< "This machine's install directory:\n"
<< " " << dir_utf8 << "\n\n"
<< "Drop an unpacked extension folder here (or copy/paste it into this directory).\n"
<< "Each folder must contain a manifest.json file.\n\n"
<< "Typical locations by OS:\n"
<< " Windows: %LOCALAPPDATA%\\Nebula\\User Data\\extensions\\\n"
<< " macOS: ~/Library/Application Support/Nebula/User Data/extensions/\n"
<< " Linux: ~/.local/share/Nebula/User Data/extensions/\n\n"
<< "Example layout:\n"
<< " extensions/\n"
<< " my-extension/\n"