為什麼 Firefox 不記得我之前在 Wolfram Alpha 上的搜尋?

為什麼 Firefox 不記得我之前在 Wolfram Alpha 上的搜尋?

我在 Wolframalpha.com 中輸入了很多查詢。當我返回網站並嘗試輸入我之前輸入的內容時,什麼也沒有發生。在其他網站(例如 superuser.com)上,如果我在搜尋框中輸入內容,Firefox 會記住我之前的查詢並向我推薦它們。為什麼這在 Alpha 上不起作用?我可以讓它與greasemonkey 腳本一起工作嗎?

<form method="get" action="/input/" accept-charset="UTF-8" autocomplete="off">
    <div id="input-background">
        <input name="i" id="i" maxlength="200" autocapitalize="off" type="text">
        <a id="iClear" style="display: none;"></a>
        <label class="hidden" for="equal">Calculate</label>
        <input id="equal" title="compute" value="Submit" type="submit">
        <div id="howTo"></div>
    </div>
</form>

答案1

Wolfram Alpha 的搜尋框具有autocomplete="off"屬性,因此瀏覽器尊重這一點,輸入框未填寫。


替代, 然而。請記住 - 這可以自動完成所有內容

1. Locate Firefox’s installation folder. Normally that’s C:\Program Files\Mozilla Firefox

2. Navigate to the components folder.

3. Open nsLoginManager.js in an editor.  As Notepad won’t do really, do this instead [if you've a proper editor, just go to step 4]:

3a) Select  Start | Run

3b) Enter cmd <enter or Ok>

3c) type cd C:\Program Files\Mozilla Firefox\components <enter>

3d) type edit nsLoginManager.js <enter>

3e) Go to step 4.

4. Find this:

    /*
     * _isAutoCompleteDisabled
     *
     * Returns true if the page requests autocomplete be disabled for the
     * specified form input.
     */
    _isAutocompleteDisabled :  function (element) {
        if (element && element.hasAttribute("autocomplete") &&
            element.getAttribute("autocomplete").toLowerCase() == "off")
            return true;

        return false;
    },
5. Change it to this:

    /*
     * _isAutoCompleteDisabled
     *
     * Returns true if the page requests autocomplete be disabled for the
     * specified form input.
     */
    _isAutocompleteDisabled :  function (element) {
        return false;
    },
6. Save the file [if you're following the 3x) steps above, select File | Exit, and when asked if you want to save the edited file, answer Yes.  To close the command prompt, enter exit <enter>].

Note that you might first have to change the file’s security permissions to do this [you DO if the save fails].  E.g., in Vista I had to A) right-click on the file [e.g., in Explorer] B) select Properties | Security. B) select Edit. C) select your username, D) change the persmissions to include Write access.

And you’re done – either start, or close/re-start Firefox!

答案2

以下是如何使用 Greasemonkey 為特定網站啟用它:

// ==UserScript==
// @name           Alpha autocomplete on
// @namespace      
// @description    Enables browser form history for Wolfram Alpha
// @include        *wolframalpha.com*
// ==/UserScript==

document.forms[0].setAttribute("autocomplete", "on")

相關內容