搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

Firefox 31 should run Greasemonkey scripts on POST pages

  • 4 个回答
  • 19 人有此问题
  • 1 次查看
  • 最后回复者为 Markus Keller

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).