fix: use file path as key for safeDialogs on filesystem (#17546)
This commit is contained in:
parent
2188a6ea99
commit
f4434763fe
1 changed files with 10 additions and 1 deletions
|
@ -41,7 +41,16 @@ void AtomJavaScriptDialogManager::RunJavaScriptDialog(
|
||||||
DialogClosedCallback callback,
|
DialogClosedCallback callback,
|
||||||
bool* did_suppress_message) {
|
bool* did_suppress_message) {
|
||||||
auto origin_url = rfh->GetLastCommittedURL();
|
auto origin_url = rfh->GetLastCommittedURL();
|
||||||
const std::string& origin = origin_url.GetOrigin().spec();
|
|
||||||
|
std::string origin;
|
||||||
|
// For file:// URLs we do the alert filtering by the
|
||||||
|
// file path currently loaded
|
||||||
|
if (origin_url.SchemeIsFile()) {
|
||||||
|
origin = origin_url.path();
|
||||||
|
} else {
|
||||||
|
origin = origin_url.GetOrigin().spec();
|
||||||
|
}
|
||||||
|
|
||||||
if (origin_counts_[origin] == kUserWantsNoMoreDialogs) {
|
if (origin_counts_[origin] == kUserWantsNoMoreDialogs) {
|
||||||
return std::move(callback).Run(false, base::string16());
|
return std::move(callback).Run(false, base::string16());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue