Page MenuHomePhabricator

Search&replace disabled in Internet Explorer 8–10, Opera
Closed, ResolvedPublic

Description

I opened this bug to ask for the restoration of a function belonging to the enhanced editing toolbar, not working in some browsers such as Opera and IE8.
This is the function "find and replace", which you can also see marked with red arrows in the following image:
[http://img697.imageshack.us/img697/7231/scrrenwiki.png]
Thank you


Version: unspecified
Severity: major

Details

Reference
bz23992

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:07 PM
bzimport set Reference to bz23992.

Search&replace is disabled in these browsers because it was broken in them; I
will see if I can fix S&R for IE at least.

(In reply to comment #1)

Search&replace is disabled in these browsers because it was broken in them; I
will see if I can fix S&R for IE at least.

Some news about it?

accnospamtom wrote:

The button is enbaled now, but the function is completely broken in Opera.

Example:
I tried to replace the word "Lorem" with "Kamel" and the result is this diff:

http://kamelopedia.mormo.org/index.php?title=Kamel:Nachteule/SearchReplaceBug&diff=442168&oldid=442167

Browser: Opera 11.x
MediaWiki: 1.18 r86333, 1.17wmf1 r87486

*Mass-change: Move WikiEditor bugs to component and remove blocker bug where*

Confirming for Windows XP, IE 7, 800x600px,
https://en.wikipedia.org/w/index.php?title=Louisiana_State_Archive_and_Research_Library&action=edit
on browserstack.com, not being logged in.
Same problem for Opera 12.14, not being logged in.

Works correctly in Google Chrome 24 (not logged in) and Firefox 18 (logged in).

  • Bug 48305 has been marked as a duplicate of this bug. ***

dawpa2000 wrote:

Did anyone else take a look at "jquery.textSelection.js"? Like I said on
2012-02-07, the bug is on line 65:

getContents: function () {
    return this.val();
},

https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=blob;f=resources/jquery/jquery.textSelection.js#l65

In "jquery.textSelection.js", there are a few bugs with handling newlines.

For Opera, the only change required is to the getContents function.

There are more bugs regarding Internet Explorer. The if statements in "jquery.textSelection.js" should be reversed. You want to check for W3C way first and then fallback to Internet Explorer way.

Furthermore, the newline strings should not be hardcoded. This causes problems when the browser has a different newline than what was expected, which results in off-by-one errors.

Experiment with the following example:

function getNewline() {
   var document = window.document;
   var textarea = document.createElement("textarea");
   textarea.value = "\n";
   return textarea.value;
}

var newline = getNewline();

Running in IE8 mode and Opera 11.50, 11.60:

newline.length

2

newline === "\r\n"

true

newline === "\n"

false

Running in IE9 mode and Opera 11.64:

newline.length

1

newline === "\r\n"

false

newline === "\n"

true

Seems like 'search and replace' for IE & Opera are both disabled in jquery.wikiEditor.dialogs.config.js (line #1100)

	'search-and-replace': {
		'browsers': {
 			// Left-to-right languages
 			'ltr': {
 				'msie': false,
 				'firefox': [['>=', 2]],
 				'opera': false,
 				'safari': [['>=', 3]],
 				'chrome': [['>=', 3]]
			},
			// Right-to-left languages
 			'rtl': {
 				'msie': false,
 				'firefox': [['>=', 2]],
 				'opera': false,
 				'safari': [['>=', 3]],
 				'chrome': [['>=', 3]]
 			}
		},

...No?

Seems like 'search and replace' for IE & Opera are both disabled in jquery.wikiEditor.dialogs.config.js (line #1100)

Yep, as comment 1 said.

Well that was 4 years and at least 2 versions of IE ago.
Do you think something might have changed in the interim?
We will never know unless some minimum version level(s) is reinstated.

Well that was 4 years and at least 2 versions of IE ago.
Do you think something might have changed in the interim?
We will never know unless some minimum version level(s) is reinstated.

since "replace" is fundamentally borked on *all* browsers ATM (can't recall bug#, sorry. you can try some simple replace operations to see the issue - *not* "replace all", just simple "replace"), i do not see much calue in enabling it for IE&opera.

IMO, s&r is very important, and should be fixed asap, first for the sane browsers (geko and webkit), and eventually for all, but unfortunately it seems this is low priority. maybe we can divert tiny potion of the resources currently dedicated to VE and fix s&r?

(
side note: one thing i would love to see is teaching s&r form to be persistent, i.e., retain its content between calls, even for different pages.
please see https://en.wikipedia.org/wiki/User:קיפודנחש/searchPersistence.js
)

since "replace" is fundamentally borked on *all* browsers ATM (can't recall bug#, sorry. you can try some simple replace operations to see the issue - *not* "replace all", just simple "replace"), I do not see much value in enabling it for IE &/or opera.

If there is no value in enabling it for IE &/or Opera, then developers should either

  • keep rendering the S&R button as is but display a message saying as much re: browser incompatibility when that button is selected; or
  • stop rendering the S&R button altogether on those browser versions below the acceptable version level or those browsers that are completely disabled.

Rendering a button that does nothing when selected in the layman's world means a function that should be available to them is not working. By that logic, its broke -- browser incompatibility & similar developer nuances be damned -- end of story.

It would not work now. IE8 is meant to be disabled for javascript in January in mediawiki.

Nemo_bis renamed this task from Search&replace disabled in IE8, Opera to Search&replace disabled in Internet Explorer 8–10, Opera.Dec 16 2015, 9:38 AM
Nemo_bis set Security to None.

@PlavorSeol for what reason? You believe that this only happens on IE8? Works for you on IE9+ and Edge?

TheDJ claimed this task.
TheDJ subscribed.

There are no longer any browser exclusions in WikiEditor. All browser exclusions are dictated from where MediaWiki core provides support.