Conversation.WebView: Convert to using messages for JS → client comms
This commit is contained in:
parent
3655f4896f
commit
7b0146274c
2 changed files with 37 additions and 36 deletions
|
|
@ -26,6 +26,8 @@ ConversationPageState.prototype = {
|
|||
init: function() {
|
||||
PageState.prototype.init.apply(this, []);
|
||||
|
||||
this._deceptiveLinkClicked = MessageSender("deceptive_link_clicked");
|
||||
|
||||
let state = this;
|
||||
document.addEventListener("click", function(e) {
|
||||
if (e.target.tagName == "A" &&
|
||||
|
|
@ -267,7 +269,7 @@ ConversationPageState.prototype = {
|
|||
let reason = ConversationPageState.isDeceptiveText(text, href);
|
||||
if (reason != ConversationPageState.NOT_DECEPTIVE) {
|
||||
cancelClick = true;
|
||||
window.webkit.messageHandlers.deceptiveLinkClicked.postMessage({
|
||||
this._deceptiveLinkClicked({
|
||||
reason: reason,
|
||||
text: text,
|
||||
href: href,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue