feat: redesign preload APIs (#45230)
* feat: redesign preload APIs * docs: remove service-worker mentions for now * fix lint * remove service-worker ipc code * add filename * fix: web preferences preload not included * fix: missing common init * fix: preload bundle script error
This commit is contained in:
parent
26d228ccfe
commit
e09577b123
19 changed files with 459 additions and 149 deletions
|
@ -30,22 +30,4 @@ SessionPreferences* SessionPreferences::FromBrowserContext(
|
|||
return static_cast<SessionPreferences*>(context->GetUserData(&kLocatorKey));
|
||||
}
|
||||
|
||||
// static
|
||||
std::vector<base::FilePath> SessionPreferences::GetValidPreloads(
|
||||
content::BrowserContext* context) {
|
||||
std::vector<base::FilePath> result;
|
||||
|
||||
if (auto* self = FromBrowserContext(context)) {
|
||||
for (const auto& preload : self->preloads()) {
|
||||
if (preload.IsAbsolute()) {
|
||||
result.emplace_back(preload);
|
||||
} else {
|
||||
LOG(ERROR) << "preload script must have absolute path: " << preload;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
} // namespace electron
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue