From: John Foerch Date: Mon, 15 Oct 2012 20:27:25 +0000 (-0400) Subject: gmail-mode: remove gmail_focus_primary_frame X-Git-Tag: debian-1.0--pre-1+git160130-1~231 X-Git-Url: https://repo.or.cz/w/conkeror.git/commitdiff_plain/56159a7bcfd7f0379c19f4e07a259495903ea919 gmail-mode: remove gmail_focus_primary_frame According to users of gmail-mode, GMail has been changed in some way that caused keys to no longer work. Experimentation showed that gmail_focus_primary_frame was the source of the problem, in that it was focusing the wrong frame, but when removed altogether, the page-mode worked fine. Tested by Tim Ramsey and Jean-Baptiste Mestelan. --- diff --git a/modules/page-modes/gmail.js b/modules/page-modes/gmail.js index 930de2b..8bbe0a6 100644 --- a/modules/page-modes/gmail.js +++ b/modules/page-modes/gmail.js @@ -59,33 +59,10 @@ define_key(gmail_keymap, "return", null, $fallthrough); define_key(gmail_keymap, "tab", null, $fallthrough); -var gmail_modality = { - normal: gmail_keymap -}; - -function gmail_focus_primary_frame (buffer) { - var frames = buffer.top_frame.frames; - if (frames.length >= 4) - buffer.top_frame.frames[3].focus(); -} - -define_page_mode("gmail-mode", +define_keymaps_page_mode("gmail-mode", build_url_regexp($domain = "mail.google", $path = new RegExp('(?!support)')), - function enable (buffer) { - add_hook.call(buffer, "buffer_dom_content_loaded_hook", - gmail_focus_primary_frame); - add_hook.call(buffer, "unfocus_hook", gmail_focus_primary_frame); - buffer.content_modalities.push(gmail_modality); - }, - function disable (buffer) { - remove_hook.call(buffer, "buffer_dom_content_loaded_hook", - gmail_focus_primary_frame); - remove_hook.call(buffer, "unfocus_hook", gmail_focus_primary_frame); - var i = buffer.content_modalities.indexOf(gmail_modality); - if (i > -1) - buffer.content_modalities.splice(i, 1); - }, + { normal: gmail_keymap }, $display_name = "GMail"); page_mode_activate(gmail_mode);