你的 .conkerorrc 是什么样的?

发布于 2024-07-18 04:58:25 字数 570 浏览 4 评论 0原文

Conkeror 改变了我浏览网页的方式:它基本上是 Emacs + Firefox,在 .conkerrorc 而不是 .emacs 中的 elisp 配置。

多年来,我通过从其他人那里获取一些零碎的东西,建立了一个巨大的 .emacs 自定义库。 我刚刚从 Conkeror 开始,但它使用 JS(比 Elisp 更广为人知)这一事实一定意味着那里有一些令人惊奇的东西。

愿意分享你的作品吗? 我对与 Django 生成的页面(或其他动态网页)交互良好的内容特别感兴趣。

例如,我想要一个基于 Conkeror 的动作记录器,它可以让我浏览网站并发现bug,然后立即保存& 只需按一下键即可将操作序列作为错误报告提交。 通过包含复制错误所需的 JS 操作,它将成为最终的测试工具——甚至比 Selenium 更好,因为它将完全由键盘驱动。

Conkeror has changed the way I browse the web: it's basically Emacs + Firefox with javascript based configuration in .conkerrorc rather than elisp configuration in .emacs.

I've built up a huge library of .emacs customizations over the years by getting little bits and pieces from others. I'm just starting with Conkeror but the fact that it uses JS (far more widely known than Elisp) must mean that there's some amazing stuff out there.

Care to share your pieces? I'm particularly interested in stuff that interacts well with pages produced by Django (or other dynamic web pages).

For example, I'd love a Conkeror-based action recorder that let me browse a site and find bugs, and then immediately save & submit the sequence of actions as a bug report with a single keystroke. By including the JS actions required to replicate the error, it would be the ultimate testing harness -- even better than Selenium because it would be totally keyboard driven.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

女皇必胜 2024-07-25 04:58:25

这是我的:

// homepage = "http://www.google.com";

// set default webjump
read_url_handler_list = [read_url_make_default_webjump_handler("google")];
// possibly valid URL
function possibly_valid_url (str) {
    return (/[\.\/:]/.test(str)) &&
        !(/\S\s+\S/.test(str)) &&
        !(/^\s*$/.test(str));
}

// page modes
require("page-modes/google-search-results.js"); // google search results
require("page-modes/wikipedia.js");     // wikipedia mode

// webjumps
define_webjump("gmail", "https://mail.google.com"); // gmail inbox
define_webjump("twitter", "http://twitter.com/#!/search/%s", $alternative = "https://twitter.com/");  // twitter
define_webjump("w3schools", "http://www.w3schools.com"); // w3schools site
define_webjump("w3search", "http://www.google.com/search?sitesearch=www.w3schools.com&as_q=%s"); // w3schools search
define_webjump("jquery", "http://docs.jquery.com/Special:Search?ns0=1&search=%s"); // jquery
define_webjump("archwiki", "https://wiki.archlinux.org/index.php?search=%s"); // arch wiki
define_webjump("stackoverflow", "http://stackoverflow.com/search?q=%s", $alternative = "http://stackoverflow.com/"); // stackoverflow
define_webjump("sor", "http://stackoverflow.com/search?q=[r]+%s", $alternative = "http://stackoverflow.com/questions/tagged/r"); // stackoverflow R section
define_webjump("stats", "http://stats.stackexchange.com/search?q=%s"); // stats
define_webjump("torrentz", "http://torrentz.eu/search?q=%s"); // torrentz
define_webjump("avaxsearch", "http://avaxsearch.com/avaxhome_search?q=%s&a=&c=&l=&sort_by=&commit=Search"); // avaxsearch
define_webjump("imdb", "http://www.imdb.com/find?s=all;q=%s"); // imdb
define_webjump("duckgo", "http://duckduckgo.com/?q=%s", $alternative = "http://duckduckgo.com"); // duckduckgo
define_webjump("blekko", "http://blekko.com/ws/%s", $alternative = "http://blekko.com/"); // blekko
define_webjump("youtube", "http://www.youtube.com/results?search_query=%s&aq=f", $alternative = "http://www.youtube.com"); // youtube
define_webjump("duckgossl", "https://duckduckgo.com/?q=%s"); // duckduckgo SSL
define_webjump("downforeveryoneorjustme", "http://www.downforeveryoneorjustme.com/%s"); // downforeveryoneorjustme
define_webjump("urbandictionary", "http://www.urbandictionary.com/define.php?term=%s"); // urban dictionary
define_webjump("rts", "http://rts.rs");             // RTS
define_webjump("facebook", "http://www.facebook.com");      // facebook homepage

// tab bar
require("new-tabs.js");

// clicks in new buffer
require("clicks-in-new-buffer.js");
// Set to either OPEN_NEW_BUFFER(_BACKGROUND)
clicks_in_new_buffer_target = OPEN_NEW_BUFFER_BACKGROUND; // Now buffers open in background.

// history webjump
define_browser_object_class(
    "history-url", null, 
    function (I, prompt) {
        check_buffer (I.buffer, content_buffer);
        var result = yield I.buffer.window.minibuffer.read_url(
            $prompt = prompt,  $use_webjumps = false, $use_history = true, $use_bookmarks = false);
        yield co_return (result);
    });

interactive("find-url-from-history",
            "Find a page from history in the current buffer",
            "find-url",
            $browser_object = browser_object_history_url);

interactive("find-url-from-history-new-buffer",
            "Find a page from history in the current buffer",
            "find-url-new-buffer",
            $browser_object = browser_object_history_url);

define_key(content_buffer_normal_keymap, "h", "find-url-from-history-new-buffer");
define_key(content_buffer_normal_keymap, "H", "find-url-from-history");

// load session module
require("session.js");
session_auto_save_auto_load = true; // auto-load session

// don't open download buffer automatically
remove_hook("download_added_hook", open_download_buffer_automatically);

// don't show clock
remove_hook("mode_line_hook", mode_line_adder(clock_widget));

// add favicons
require("favicon");
add_hook("mode_line_hook", mode_line_adder(buffer_icon_widget), true);
read_buffer_show_icons = true;

// add content handlers
content_handlers.set("application/pdf", content_handler_save); // pdf
// torrent
// mp3
// ogg

function define_switch_buffer_key (key, buf_num) {
    define_key(default_global_keymap, key,
               function (I) {
           switch_to_buffer(I.window,
                                    I.window.buffers.get_buffer(buf_num));
               });
}
for (let i = 0; i < 10; ++i) {
    define_switch_buffer_key(String((i+1)%10), i);
}

function enable_scrollbars (buffer) {
    buffer.top_frame.scrollbars.visible = true;
}
add_hook("create_buffer_late_hook", enable_scrollbars);

Here's mine:

// homepage = "http://www.google.com";

// set default webjump
read_url_handler_list = [read_url_make_default_webjump_handler("google")];
// possibly valid URL
function possibly_valid_url (str) {
    return (/[\.\/:]/.test(str)) &&
        !(/\S\s+\S/.test(str)) &&
        !(/^\s*$/.test(str));
}

// page modes
require("page-modes/google-search-results.js"); // google search results
require("page-modes/wikipedia.js");     // wikipedia mode

// webjumps
define_webjump("gmail", "https://mail.google.com"); // gmail inbox
define_webjump("twitter", "http://twitter.com/#!/search/%s", $alternative = "https://twitter.com/");  // twitter
define_webjump("w3schools", "http://www.w3schools.com"); // w3schools site
define_webjump("w3search", "http://www.google.com/search?sitesearch=www.w3schools.com&as_q=%s"); // w3schools search
define_webjump("jquery", "http://docs.jquery.com/Special:Search?ns0=1&search=%s"); // jquery
define_webjump("archwiki", "https://wiki.archlinux.org/index.php?search=%s"); // arch wiki
define_webjump("stackoverflow", "http://stackoverflow.com/search?q=%s", $alternative = "http://stackoverflow.com/"); // stackoverflow
define_webjump("sor", "http://stackoverflow.com/search?q=[r]+%s", $alternative = "http://stackoverflow.com/questions/tagged/r"); // stackoverflow R section
define_webjump("stats", "http://stats.stackexchange.com/search?q=%s"); // stats
define_webjump("torrentz", "http://torrentz.eu/search?q=%s"); // torrentz
define_webjump("avaxsearch", "http://avaxsearch.com/avaxhome_search?q=%s&a=&c=&l=&sort_by=&commit=Search"); // avaxsearch
define_webjump("imdb", "http://www.imdb.com/find?s=all;q=%s"); // imdb
define_webjump("duckgo", "http://duckduckgo.com/?q=%s", $alternative = "http://duckduckgo.com"); // duckduckgo
define_webjump("blekko", "http://blekko.com/ws/%s", $alternative = "http://blekko.com/"); // blekko
define_webjump("youtube", "http://www.youtube.com/results?search_query=%s&aq=f", $alternative = "http://www.youtube.com"); // youtube
define_webjump("duckgossl", "https://duckduckgo.com/?q=%s"); // duckduckgo SSL
define_webjump("downforeveryoneorjustme", "http://www.downforeveryoneorjustme.com/%s"); // downforeveryoneorjustme
define_webjump("urbandictionary", "http://www.urbandictionary.com/define.php?term=%s"); // urban dictionary
define_webjump("rts", "http://rts.rs");             // RTS
define_webjump("facebook", "http://www.facebook.com");      // facebook homepage

// tab bar
require("new-tabs.js");

// clicks in new buffer
require("clicks-in-new-buffer.js");
// Set to either OPEN_NEW_BUFFER(_BACKGROUND)
clicks_in_new_buffer_target = OPEN_NEW_BUFFER_BACKGROUND; // Now buffers open in background.

// history webjump
define_browser_object_class(
    "history-url", null, 
    function (I, prompt) {
        check_buffer (I.buffer, content_buffer);
        var result = yield I.buffer.window.minibuffer.read_url(
            $prompt = prompt,  $use_webjumps = false, $use_history = true, $use_bookmarks = false);
        yield co_return (result);
    });

interactive("find-url-from-history",
            "Find a page from history in the current buffer",
            "find-url",
            $browser_object = browser_object_history_url);

interactive("find-url-from-history-new-buffer",
            "Find a page from history in the current buffer",
            "find-url-new-buffer",
            $browser_object = browser_object_history_url);

define_key(content_buffer_normal_keymap, "h", "find-url-from-history-new-buffer");
define_key(content_buffer_normal_keymap, "H", "find-url-from-history");

// load session module
require("session.js");
session_auto_save_auto_load = true; // auto-load session

// don't open download buffer automatically
remove_hook("download_added_hook", open_download_buffer_automatically);

// don't show clock
remove_hook("mode_line_hook", mode_line_adder(clock_widget));

// add favicons
require("favicon");
add_hook("mode_line_hook", mode_line_adder(buffer_icon_widget), true);
read_buffer_show_icons = true;

// add content handlers
content_handlers.set("application/pdf", content_handler_save); // pdf
// torrent
// mp3
// ogg

function define_switch_buffer_key (key, buf_num) {
    define_key(default_global_keymap, key,
               function (I) {
           switch_to_buffer(I.window,
                                    I.window.buffers.get_buffer(buf_num));
               });
}
for (let i = 0; i < 10; ++i) {
    define_switch_buffer_key(String((i+1)%10), i);
}

function enable_scrollbars (buffer) {
    buffer.top_frame.scrollbars.visible = true;
}
add_hook("create_buffer_late_hook", enable_scrollbars);
请远离我 2024-07-25 04:58:25

由于似乎没有人有兴趣发布实际回复,所以我会的。

function my_title_format (window) {
   return 'conkeror {'+get_current_profile()+'}'+window.buffers.current.description;
}

我发现在窗口标题中包含配置文件名称很有帮助,因为我使用多个配置文件。 现在我使用 StumpWM 并且不看窗口,这对我没有太大帮助列出很多,但它在其他窗口管理器中非常有帮助。

define_key(content_buffer_normal_keymap, "C-x C-c", "confirm-quit");
can_kill_last_buffer = false;

这两个可以防止我通过关闭最后一个缓冲区来意外关闭 conkeror 窗口。

Since no one else seems interested in posting an actual reply, I will.

function my_title_format (window) {
   return 'conkeror {'+get_current_profile()+'}'+window.buffers.current.description;
}

I find it helpful to have the profile name in the window title as I use multiple profiles. It doesn't help me so much now that I use StumpWM and don't look at the window list much, but it's very helpful in other window managers.

define_key(content_buffer_normal_keymap, "C-x C-c", "confirm-quit");
can_kill_last_buffer = false;

These two keep me from accidentally closing a conkeror window by closing the last buffer.

只想待在家 2024-07-25 04:58:25

好吧,我真的帮不了你,但我只是想说,虽然我是一个 emacs 人,但我放弃了 Conkeror,转而使用 vimperator 因为恕我直言,浏览体验要好得多!

Well, I can't really help you here but I just wanted to say that although I'm an emacs guy, I dropped Conkeror for vimperator because IMHO the browsing experience is much better!

挥剑断情 2024-07-25 04:58:25

Conkeror 只是带有 Emacs 键绑定的 Firefox。 我不认为它是、也不打算成为像 Emacs 这样功能齐全的环境。

它允许您使用陈旧的 Emacs 肌肉记忆,从而改善您的浏览体验。 并且让您的手更多地放在键盘上,而不是一直从键盘跳到鼠标。

所以我不认为它真的有能力做你想象的一些事情。

它的发展也相当缓慢,而且可能人手不足。 例如,您会发现您无法使用最常见的 Firefox 插件/扩展。 Firebug、Greasemonkey、Gears 等。

我确实喜欢用它来执行某些浏览任务:它具有用于阅读 Reddit、Google Reader 和其他内容的特殊模式,使事情变得更加容易。

但我也同意 binOr 的观点,即 vimperator 更好,即使您是 emacs 人员。 如果你使用 VIM 当然会有帮助。

Conkeror is merely Firefox with Emacs keybindings. I don't think it is, and nor does it intend to be, a fully featured environment as Emacs is.

It facilitates your browsing experience by allowing you to use your well-worn Emacs muscle memory. And lets you keep your hands on the keyboard more, instead of jumping from keyboard to mouse all the time.

So I don't think it is really capable of doing some of the things you imagine.

Its development is also rather slow and is probably understaffed. You'll find, for example, that you can't use most common Firefox addons/extensions with it. Firebug, Greasemonkey, Gears, etc.

I do like it for some browsing tasks: it has special modes for reading Reddit, Google Reader, and others that make things a lot easier.

But I also agree with binOr that vimperator is much better, even if you're an emacs guy. Helps if you use VIM of course.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文