diff --git a/atom/app/atom_content_client.cc b/atom/app/atom_content_client.cc index c9c41404d4a2..40a6e1f5268d 100644 --- a/atom/app/atom_content_client.cc +++ b/atom/app/atom_content_client.cc @@ -181,20 +181,6 @@ void AtomContentClient::AddAdditionalSchemes( std::vector* standard_schemes, std::vector* referrer_schemes, std::vector* savable_schemes) { - // Parse --standard-schemes=scheme1,scheme2 - auto command_line = base::CommandLine::ForCurrentProcess(); - std::string custom_schemes = command_line->GetSwitchValueASCII( - switches::kStandardSchemes); - if (!custom_schemes.empty()) { - // Note that url::SchemeWithType requires passing const char*, so we have - // to ensure the string still lives after this function exits. - static std::vector schemes_list; - schemes_list = base::SplitString( - custom_schemes, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); - for (const std::string& scheme : schemes_list) - standard_schemes->push_back({scheme.c_str(), url::SCHEME_WITHOUT_PORT}); - } - standard_schemes->push_back({"chrome-extension", url::SCHEME_WITHOUT_PORT}); } diff --git a/atom/renderer/atom_renderer_client.cc b/atom/renderer/atom_renderer_client.cc index ee2dd7d54e04..99b00227c3b1 100644 --- a/atom/renderer/atom_renderer_client.cc +++ b/atom/renderer/atom_renderer_client.cc @@ -122,6 +122,16 @@ bool IsDevToolsExtension(content::RenderFrame* render_frame) { AtomRendererClient::AtomRendererClient() : node_bindings_(NodeBindings::Create(false)), atom_bindings_(new AtomBindings) { + // Parse --standard-schemes=scheme1,scheme2 + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); + std::string custom_schemes = command_line->GetSwitchValueASCII( + switches::kStandardSchemes); + if (!custom_schemes.empty()) { + std::vector schemes_list = base::SplitString( + custom_schemes, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); + for (const std::string& scheme : schemes_list) + url::AddStandardScheme(scheme.c_str(), url::SCHEME_WITHOUT_PORT); + } } AtomRendererClient::~AtomRendererClient() {