feat: [extensions] background pages (#21591)
This commit is contained in:
parent
cf497ea478
commit
8bc0c92137
23 changed files with 477 additions and 11 deletions
|
@ -16,6 +16,7 @@
|
|||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "content/public/common/content_constants.h"
|
||||
#include "electron/buildflags/buildflags.h"
|
||||
#include "extensions/common/constants.h"
|
||||
#include "ppapi/buildflags/buildflags.h"
|
||||
#include "shell/browser/atom_paths.h"
|
||||
#include "shell/common/options_switches.h"
|
||||
|
@ -225,7 +226,7 @@ void AtomContentClient::AddAdditionalSchemes(Schemes* schemes) {
|
|||
&schemes->cors_enabled_schemes);
|
||||
|
||||
schemes->service_worker_schemes.emplace_back(url::kFileScheme);
|
||||
schemes->standard_schemes.emplace_back("chrome-extension");
|
||||
schemes->standard_schemes.emplace_back(extensions::kExtensionScheme);
|
||||
}
|
||||
|
||||
void AtomContentClient::AddPepperPlugins(
|
||||
|
|
|
@ -19,8 +19,10 @@
|
|||
#include "base/mac/bundle_locations.h"
|
||||
#include "base/path_service.h"
|
||||
#include "chrome/common/chrome_paths.h"
|
||||
#include "components/content_settings/core/common/content_settings_pattern.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "electron/buildflags/buildflags.h"
|
||||
#include "extensions/common/constants.h"
|
||||
#include "ipc/ipc_buildflags.h"
|
||||
#include "services/service_manager/embedder/switches.h"
|
||||
#include "services/service_manager/sandbox/switches.h"
|
||||
|
@ -131,6 +133,11 @@ AtomMainDelegate::AtomMainDelegate() = default;
|
|||
|
||||
AtomMainDelegate::~AtomMainDelegate() = default;
|
||||
|
||||
const char* const AtomMainDelegate::kNonWildcardDomainNonPortSchemes[] = {
|
||||
extensions::kExtensionScheme};
|
||||
const size_t AtomMainDelegate::kNonWildcardDomainNonPortSchemesSize =
|
||||
base::size(kNonWildcardDomainNonPortSchemes);
|
||||
|
||||
bool AtomMainDelegate::BasicStartupComplete(int* exit_code) {
|
||||
auto* command_line = base::CommandLine::ForCurrentProcess();
|
||||
|
||||
|
@ -187,6 +194,10 @@ bool AtomMainDelegate::BasicStartupComplete(int* exit_code) {
|
|||
tracing::TracingSamplerProfiler::CreateOnMainThread();
|
||||
|
||||
chrome::RegisterPathProvider();
|
||||
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
|
||||
ContentSettingsPattern::SetNonWildcardDomainNonPortSchemes(
|
||||
kNonWildcardDomainNonPortSchemes, kNonWildcardDomainNonPortSchemesSize);
|
||||
#endif
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
OverrideChildProcessPath();
|
||||
|
|
|
@ -21,6 +21,8 @@ void LoadResourceBundle(const std::string& locale);
|
|||
|
||||
class AtomMainDelegate : public content::ContentMainDelegate {
|
||||
public:
|
||||
static const char* const kNonWildcardDomainNonPortSchemes[];
|
||||
static const size_t kNonWildcardDomainNonPortSchemesSize;
|
||||
AtomMainDelegate();
|
||||
~AtomMainDelegate() override;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue