為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

Firefox 31 should run Greasemonkey scripts on POST pages

more options

The Firefox 31 update has broken some Greasemonkey 2.1 functionality. Greasemonkey scripts are not run anymore on pages that are shown as response to a POST event. Works fine again when I revert to Firefox 30.

Steps: - Install https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/ - Install https://www.eclipse.org/jdt/ui/scripts/jdtbugzilla.user.js - Go to https://bugs.eclipse.org/bugs/query.cgi?format=advanced

   => page is correctly tweaked (e.g. "eclipse bugs" header image removed)

- Select some filters (e.g. Target Milestone 4.5 M1) and click Search

   => result list is not tweaked (e.g. bug summaries are underlined)

The first action in the script is the following, which isn't executed on the POST page: console.log("Running jdtbugzilla.user.js on " + window.location);

Filed https://github.com/greasemonkey/greasemonkey/issues/1977 for this, but the bug could just as well be in Firefox. Maybe same issue as https://support.mozilla.org/en-US/questions/1012688

The Firefox 31 update has broken some Greasemonkey 2.1 functionality. Greasemonkey scripts are not run anymore on pages that are shown as response to a POST event. Works fine again when I revert to Firefox 30. Steps: - Install https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/ - Install https://www.eclipse.org/jdt/ui/scripts/jdtbugzilla.user.js - Go to https://bugs.eclipse.org/bugs/query.cgi?format=advanced => page is correctly tweaked (e.g. "eclipse bugs" header image removed) - Select some filters (e.g. Target Milestone 4.5 M1) and click Search => result list is not tweaked (e.g. bug summaries are underlined) The first action in the script is the following, which isn't executed on the POST page: console.log("Running jdtbugzilla.user.js on " + window.location); Filed https://github.com/greasemonkey/greasemonkey/issues/1977 for this, but the bug could just as well be in Firefox. Maybe same issue as https://support.mozilla.org/en-US/questions/1012688

被選擇的解決方法

With the infos from https://github.com/greasemonkey/greasemonkey/issues/1970 , I could write this workaround script for FF 31: https://www.eclipse.org/jdt/ui/scripts/jdtbugzilla-start.user.js

This template could help others create a workaround for their broken pages:

// ==UserScript==
// @name        Remove history.replaceState from buglist.cgi
// @description Removes history.replaceState from buglist.cgi to work around https://github.com/greasemonkey/greasemonkey/issues/1970
// @include     https://your/page*

// @version 1
// @grant       none
// @run-at document-start
// ==/UserScript==
history.replaceState = function(data, title, url) {
	console.log("caught history.replaceState(" + data + ", " + title + ", " + url + ")");
};
從原來的回覆中察看解決方案 👍 1

所有回覆 (4)

more options

I took a screenshot after installing on a windows 7 VM on the right. The left is view of the last page without Greasemonkey.

However the header is only removed on that first page. After searching the header came back.

I attached the errors from the Browser Console, if this is a Firefox issue we can file a bug in bugzilla, but this is not my technical expertise.

It also looks like the issue on github continued in this issue: https://github.com/greasemonkey/greas.../1970

more options

選擇的解決方法

With the infos from https://github.com/greasemonkey/greasemonkey/issues/1970 , I could write this workaround script for FF 31: https://www.eclipse.org/jdt/ui/scripts/jdtbugzilla-start.user.js

This template could help others create a workaround for their broken pages:

// ==UserScript==
// @name        Remove history.replaceState from buglist.cgi
// @description Removes history.replaceState from buglist.cgi to work around https://github.com/greasemonkey/greasemonkey/issues/1970
// @include     https://your/page*

// @version 1
// @grant       none
// @run-at document-start
// ==/UserScript==
history.replaceState = function(data, title, url) {
	console.log("caught history.replaceState(" + data + ", " + title + ", " + url + ")");
};
more options

I cross referenced the post to the issue in github. Would this template replace the history record?

more options

> Would this template replace the history record?

No, it effectively disables the history.replaceState() function. The URL in the history will not be updated any more, but that's less of an issue for me than not having the script run at all.

Note that my script just works for pages like Bugzilla that use the replaceState() function. For other pages, you may have to replace the pushState() function.

In https://github.com/greasemonkey/greasemonkey/issues/1970#issuecomment-50781923 , the Greasemonkey developer identified where GM fails, so I eventually expect a real solution from him (or a bug report for Firefox if he can't cope with FF's changed behavior).