Skip to content

Commit

Permalink
expose homepage and title to brave://adblock UI frontend code
Browse files Browse the repository at this point in the history
  • Loading branch information
antonok-edm committed May 20, 2022
1 parent 1a9b680 commit a6958c3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions browser/ui/webui/brave_adblock_ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,12 @@ void AdblockDOMHandler::RefreshSubscriptionsList() {
subscription.last_update_attempt.ToJsTime());
dict->SetDoubleKey("last_successful_update_attempt",
subscription.last_successful_update_attempt.ToJsTime());
if (subscription.homepage) {
dict->SetStringKey("homepage", *subscription.homepage);
}
if (subscription.title) {
dict->SetStringKey("title", *subscription.title);
}
list_value->Append(std::move(dict));
}
CallJavascriptFunction("brave_adblock.onGetListSubscriptions", *list_value);
Expand Down
2 changes: 2 additions & 0 deletions components/definitions/adBlock.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@ declare namespace AdBlock {
last_update_attempt: number
last_successful_update_attempt: number
enabled: boolean
title?: string
homepage?: string
}
}

0 comments on commit a6958c3

Please sign in to comment.