Skip to content

Commit

Permalink
Uplift of #9984 (squashed) to beta
Browse files Browse the repository at this point in the history
  • Loading branch information
brave-browser-releases committed Sep 8, 2021
1 parent 3737252 commit 7983d43
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ void BraveNewTabMessageHandler::OnJavascriptDisallowed() {
if (tor_launcher_factory_)
tor_launcher_factory_->RemoveObserver(this);
#endif
weak_ptr_factory_.InvalidateWeakPtrs();
}

void BraveNewTabMessageHandler::HandleGetPreferences(
Expand Down Expand Up @@ -726,6 +727,11 @@ void BraveNewTabMessageHandler::HandleTodayGetDisplayAd(
if (!handler) {
return;
}

if (!handler->IsJavascriptAllowed()) {
return;
}

if (!success) {
handler->ResolveJavascriptCallback(base::Value(callback_id),
std::move(base::Value()));
Expand Down

0 comments on commit 7983d43

Please sign in to comment.