Skip to content
Permalink
Browse files

fix: use file path as key for safeDialogs on filesystem (#17579)

  • Loading branch information...
trop authored and MarshallOfSound committed Mar 27, 2019
1 parent f3a2c27 commit 0e5d181cc9301433a4195b20875d807f6b22c40b
Showing with 10 additions and 1 deletion.
  1. +10 −1 atom/browser/atom_javascript_dialog_manager.cc
@@ -41,7 +41,16 @@ void AtomJavaScriptDialogManager::RunJavaScriptDialog(
DialogClosedCallback callback,
bool* did_suppress_message) {
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) {
return std::move(callback).Run(false, base::string16());
}

0 comments on commit 0e5d181

Please sign in to comment.
You can’t perform that action at this time.