chore: bump chromium to 119.0.6019.2 (main) (#39925)
* chore: bump chromium in DEPS to 119.0.6018.4 * chore: update patches * chore: bump chromium in DEPS to 119.0.6019.2 * chore: update patches * 4876292: Roll libc++ from 7cee6b00d34a to 3e8a3b3c5d49 (6 revisions)4876292
* 4851616: [Extensions] Enable matchOriginAsFallback for dynamic content scripts4851616
* 4869393: [Extensions UserScripts] Add error messages for script matching errors4869393
--------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
parent
7685f27b31
commit
28eda03aba
29 changed files with 120 additions and 98 deletions
|
@ -38,6 +38,7 @@
|
|||
#include "extensions/common/mojom/run_location.mojom-shared.h"
|
||||
#include "extensions/common/permissions/api_permission.h"
|
||||
#include "extensions/common/permissions/permissions_data.h"
|
||||
#include "extensions/common/script_constants.h"
|
||||
#include "extensions/common/utils/content_script_utils.h"
|
||||
#include "extensions/common/utils/extension_types_utils.h"
|
||||
#include "shell/browser/api/electron_api_web_contents.h"
|
||||
|
@ -469,20 +470,34 @@ std::unique_ptr<UserScript> ParseUserScript(
|
|||
result->set_run_location(ConvertRunLocation(content_script.run_at));
|
||||
}
|
||||
|
||||
if (content_script.all_frames)
|
||||
if (content_script.all_frames) {
|
||||
result->set_match_all_frames(*content_script.all_frames);
|
||||
}
|
||||
|
||||
DCHECK(content_script.matches);
|
||||
if (!script_parsing::ParseMatchPatterns(
|
||||
*content_script.matches,
|
||||
base::OptionalToPtr(content_script.exclude_matches), definition_index,
|
||||
base::OptionalToPtr(content_script.exclude_matches),
|
||||
extension.creation_flags(), scripting::kScriptsCanExecuteEverywhere,
|
||||
valid_schemes, scripting::kAllUrlsIncludesChromeUrls, result.get(),
|
||||
error,
|
||||
/*wants_file_access=*/nullptr)) {
|
||||
error, /*wants_file_access=*/nullptr,
|
||||
/*definition_index=*/absl::nullopt)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (content_script.match_origin_as_fallback.value_or(false)) {
|
||||
if (!script_parsing::ValidateMatchOriginAsFallback(
|
||||
MatchOriginAsFallbackBehavior::kAlways, result->url_patterns(),
|
||||
error)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Default value for MatchOriginAsFallbackBehavior is `kNever`, so this only
|
||||
// needs to be set if `content_script.match_origin_as_fallback` is true.
|
||||
result->set_match_origin_as_fallback(
|
||||
MatchOriginAsFallbackBehavior::kAlways);
|
||||
}
|
||||
|
||||
if (!script_parsing::ParseFileSources(
|
||||
&extension, base::OptionalToPtr(content_script.js),
|
||||
base::OptionalToPtr(content_script.css), definition_index,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue