Sitepatching updates

tweaking the broken code until it works, one site at a time

More experiments

As discussed in a previous post supporting everything and the kitchen sink isn't always for the best.

With a small experimental update to the browser.js for Opera 11 we are taking it a bit further, disabling support for another two things that causes compatibility issues in Opera from time to time.

Update2: new file released 2010-11-16.

PATCH-328 is also now disabled, so CKEditor should be back working. Overall this was a very successful experiment, so there may be more of similar nature in the future. We will not be able to remove HTMLElement.all for now, but the goal is still to remove it at some point in the future.

PATCH-313 (disables attachEvent/detachEvent) and PATCH-331 (disables Element.removeNode) are still active, as we have not seen any feedback that they break anything so far.


Update: new file released 2010-11-11.

PATCH-329 caused some breakage as you found and Hallvord explained below. PATCH-329 has therefore been changed to only apply on shimano.com for now.

PATCH-328 removes HTMLElement.all. In IE and current Opera you can get a HTMLCollection with all children of the specified element. Like document.all, but limited to a subtree. However, we have not been able to be completely compatible with IE in which elements are included and this has caused some issues. Since Gecko and WebKit don't support this either it is probably safe to remove but we do it through browser.js first to see if it breaks anything.

PATCH-329 removes Node.document. This is another IE+Opera thing. All elements have a .document that points to the parent document (same as ownerDocument) Again, Gecko and WebKit don't have this and it causes issues on sites.

PATCH-331 removes support for Element.removeNode. Yet another IE+Opera thing. Also it works in a slightly unintuitive way and in Opera it has caused clashes with the flowjs library.

Some sites fixed by this:
Cambrian bank
Sony.ua (product description popup)
Shimano (main menu)
glow.co.uk
Southpark Studios (overlapping episode descriptions)

Can you find any that break?
Can you find any more that break?

Small updateMeebo, Facebook chat

Comments

ouzowtfouzoWTF Wednesday, November 10, 2010 2:05:49 PM

Get it out! up

MyOpera team, please fix this!fearphage Wednesday, November 10, 2010 3:37:48 PM

I say the fewer IE-isms the better. Thanks team.

d4rkn1ght Wednesday, November 10, 2010 5:42:48 PM

up

Alexsalexs Wednesday, November 10, 2010 9:06:35 PM

With this browser.js all JavaScript Prompt (quote,url,code etc.) doesn't work in Woltlab Burning Board v2.3.6.

Event thread: click
Uncaught exception: TypeError: Cannot convert 'document' to object
Error thrown at line 1, column 0 in <anonymous function>(event):
bbcode(document.bbform,'QUOTE','')

Bug: DSK-318563

No problem when disable Browser JavaScript.

MyOpera team, please fix this!fearphage Wednesday, November 10, 2010 10:24:33 PM

@Alexs: Any links to see it fail?

KujaIXKuja-IX Thursday, November 11, 2010 12:48:05 AM

Not sure if it’s related but the virtual keyboard on https://particuliers.societegenerale.fr/ for pass code entry doesn’t appear anymore since today with browser.js enabled. It should appear when you enter 8 digits in the top-right field and click Ok.
It was fixed in august http://my.opera.com/sitepatching/blog/split-file-for-10-70-and-ebay-tvguide-patches (PATCH-270).

Hallvord R. M. Steenhallvors Thursday, November 11, 2010 4:24:14 AM

Originally posted by alexs:

With this browser.js all JavaScript Prompt (quote,url,code etc.) doesn't work in Woltlab Burning Board



Wow, thanks - you found a problem pretty quickly!

I guess we're running into a limitation of our site patching here. With a custom getter, we can make someNode.document be the undefined value, but we can not remove it completely so that there is no 'document' property appearing on the node. Hence, when this inline event handler (with the node in scope) looks up 'document' it will find the document property on the node, whose value is undefined because of our custom getter..

When we do a core fix this will not be an issue - then someNode.document will truly not exist. Meanwhile, it seems we can not use browser.js for preliminary compat research for this issue after all. (If we had a simple property set on Node.prototype.document we could have just deleted it, but this is probably a getter under the hood, and dontDelete on each individual node, so AFAIK there really isn't any other way to do what we tried to do here..)

Not the end of the world, just means that we need to ship a new browser.js without the .document patch and you'll get to test the impact at a later date when the core fix lands instead of right now.

Hallvord R. M. Steenhallvors Thursday, November 11, 2010 5:06:28 AM

(I'll limit that patch to shimano.com where the element.document support caused the worst breakage IMO)

Galileo Thursday, November 11, 2010 10:31:59 AM

Another report:
Event thread: change
Uncaught exception: TypeError: Cannot convert 'document' to object
Error thrown at line 1, column 0 in <anonymous function>(event):
changeDynaList( 'catid', sectioncategories, document.adminForm.sectionid.options[document.adminForm.sectionid.selectedIndex].value, 0, 0);

The problem appears in joomla admin interface, article manager. Create a new article, you select a section but then you can't select a category, the box doesn't show any.

Ola P. Kleivenolak Thursday, November 11, 2010 12:15:00 PM

Just released a new file with PATCH-329 reverted (now only applies to Shimano.com) Now Woltlab Burning Board, Société Générale and Joomla admin should work again. Added another experiment, PATCH-331.

Hallvord R. M. Steenhallvors Thursday, November 11, 2010 12:22:27 PM

Thanks. Guess we should get a file without that patch out so that users don't have to report so many bugs about this wink

Hallvord R. M. Steenhallvors Thursday, November 11, 2010 12:23:52 PM

..and Ola did exactly that while I had this page open, before I typed my previous comment smile

Alexsalexs Thursday, November 11, 2010 12:27:15 PM

Works with version 2010-11-11, thanks. up

MyOpera team, please fix this!fearphage Thursday, November 11, 2010 4:57:02 PM

Is Opera being slotted into the IE bucket? How do Chrome and FF work on those sites without support for the IE-ism?

Ola P. Kleivenolak Thursday, November 11, 2010 7:27:58 PM

It varies. For Cambrian they used feature detection (element.all), however in 10.50 we did a change to limit tags() to document.all, so when Cambrian did element.all.tags() it broke. So that's somewhat our fault for not removing element.all at the same time.

Node.document causes trouble for some jQuery extensions. In some cases they loop over all element properties and does particular things if it finds "document". In these cases IE gets different code paths so the problem is avoided.

On southparkstudios flow.js defines its own removeNode that is slightly different from IE/Opera's, but only used if the browser has none. But here too IE gets a different code path so the issue is avoided.

So often it is a case of IE being singled out in the code, but where Opera is led down the same path due to historical compat attempts from the time when IE was fully dominant.

Galileo Thursday, November 11, 2010 8:57:35 PM

The same error

JavaScript - http://my.opera.com/Galileo/messages/
Event thread: click
Uncaught exception: TypeError: Cannot convert 'document' to object
Error thrown at line 1, column 0 in <anonymous function>(event):
document.forms.manage.operation.value='delete';

appears here in my.opera when you try to delete an inbox message.
Updated to the new update browserjs and everything is fine.

Hallvord R. M. Steenhallvors Friday, November 12, 2010 12:07:47 AM

It seems removing element.all will break CKEditor..and trying this out in browser.js is indeed giving us impressive feedback!

Thanks everyone, keep testing smile

Now off to ponder if we can still remove element.all without making Opera incompatible with every legacy install of (F)CKEditor..doesn't look good..

Patkos Csabapatkoscsaba Friday, November 12, 2010 9:54:04 AM

Does this have anything to do with problems using gmail in standard view? Lot of people reported problems with gmail not logging in since this morning. I see these lines in dragonfly error console:

Opera has modified the JavaScript on mail.google.com (Avoid Flash content on mail.google.com due to crasher). See browser.js for details
https://mail.google.com/mail/?ui=2&view=js&name=main,tlist&ver=2XB5n9DbH1E.en.&am=!dsYgKrSqQz-xhZxijtQ2BPpvY6pHEbT1HlIFnvhlJBPwLM0Vi0wp6w&fri 16 Uncaught exception: TypeError: Cannot convert undefined or null to Object

Ola P. Kleivenolak Friday, November 12, 2010 11:19:26 AM

Ah crap smile No, the Gmail load failure is unrelated to these experiments. The error lies in a faulty native implementation of Function.prototype.bind. Should be fixed soonish.

Galileo Friday, November 12, 2010 12:03:52 PM

I think it is a nice idea to announce any browserjs changes that affect snapshots also in the desktop team blog. Maybe a sidebar entry.

MyOpera team, please fix this!fearphage Friday, November 12, 2010 7:05:11 PM

Is there a test suite for a functional Function#bind? I worked around it by removing the faulty function:

// ==UserScript==
// @name          hide faulty bind implementation
// @include       *://mail.google.*
// ==/UserScript==

delete Function.prototype.bind;

Anonymous Friday, November 12, 2010 7:40:10 PM

ncc50446 writes: How do we get CFEditor to work? I need it for my job... Thanks :)

Kyle Bakerkyleabaker Friday, November 12, 2010 7:46:32 PM

Originally posted by fearphage:

// ==UserScript==
// @name hide faulty bind implementation
// @include *://mail.google.*
// ==/UserScript==

delete Function.prototype.bind;


Is this userjs intended to fix the current gmail loading issue? If so, it doesn't seem to be working for me.

MyOpera team, please fix this!fearphage Friday, November 12, 2010 7:49:41 PM

@Kyle: You're the 2nd person to say it doesn't work. I'm using Opera 11 build 1060. Are you?

Kyle Bakerkyleabaker Friday, November 12, 2010 7:54:13 PM

same: Opera 11 build 1060
Opera/9.80 (X11; Linux x86_64; U; Ubuntu/10.10 (maverick); en) Presto/2.7.39 Version/11.00

MyOpera team, please fix this!fearphage Friday, November 12, 2010 8:47:07 PM

I'll try it on linux when i get home. I don't know otherwise

idomagic Friday, November 12, 2010 10:57:26 PM

Originally posted by fearphage:

@Kyle: You're the 2nd person to say it doesn't work. I'm using Opera 11 build 1060. Are you?



Userjs on https is disabled by default, I'm guessing that's the problem.
The script is working fine for me.

To enable userjs on https go to opera:config and search for "User JavaScript on HTTPS"

Mimi's Mum (MM)mimi_s_mum Saturday, November 13, 2010 12:03:39 AM

Thanks fearphage and idomagic. That UserJS for Gmail works brilliantly! happy

11 build 10.60 on XPsp3

PengePenge4 Saturday, November 13, 2010 12:10:24 AM

Originally posted by olak:

Update: new file released 2010-11-11.


The new browser.js has broken the Gmail in the latest 11 snapshot (b1060).

Mimi's Mum (MM)mimi_s_mum Saturday, November 13, 2010 12:20:44 AM

Originally posted by Penge4:

The new browser.js has broken the Gmail in the latest 11 snapshot

No. The existing issue in 11 series was exposed by the latest change in Gmail by Google. Nothing to do with the browser.js. I've tried build 1029 (alpha) with an older browser.js released 29 October and Gmail is still broken.

And the issue can be fixed by fearphage's userJS.

FataL Saturday, November 13, 2010 5:53:05 AM

PATCH-328 (disable HTMLElement.all support) broke http://newegg.com dropdown menu.

Galileo Saturday, November 13, 2010 9:52:15 AM

Anonymous # 12. November 2010, 19:40
ncc50446 writes: How do we get CFEditor to work? I need it for my job... Thanks smile

Help>Check for updates and Opera will download the new version.

pasqal Saturday, November 13, 2010 1:49:34 PM

Originally posted by kyleabaker:

Is this userjs intended to fix the current gmail loading issue? If so, it doesn't seem to be working for me.


I have also had small problems with using this browserjs, but after some tries everything's working fine.
This script also works with Opera 10.70 build 9071.

Kyle Bakerkyleabaker Saturday, November 13, 2010 7:41:13 PM

Originally posted by idomagic:

Userjs on https is disabled by default, I'm guessing that's the problem.
The script is working fine for me.


Nope, thats the first thing I enable.

Anonymous Saturday, November 13, 2010 7:43:51 PM

Anonymous writes: How is everyone getting this Gmail script to work? I still get logged into the Basic HTML view and Google's link to Standard view does nothing.

Laurentlsaplai Saturday, November 13, 2010 8:20:06 PM

userjs doesn't seem to work for me either.
I use Opera 11 latest built 10.60 on Ubuntu 10.10.
I think I have properly enables the user js (pointed to my folder, created a file called gmail and copied the content of the script in that file). I also enables https for user js.

sad

Also, we have the same issue with 10.63 on WinXP...

Mimi's Mum (MM)mimi_s_mum Saturday, November 13, 2010 8:35:21 PM

Originally posted by anonymous:

I still get logged into the Basic HTML view and Google's link to Standard view does nothing.

Maybe you'll have to login using another browser (Such as your default 10.63), switch to the standard view, log out and then try again?

Originally posted by lsaplai:

Also, we have the same issue with 10.63 on WinXP...

Strange. My 10.63 is effortlessly loading the same gmail account 11/1060 could not load without fearphage's UserJS. Maybe you have another issue on your side?

Anonymous Sunday, November 14, 2010 2:02:16 AM

Anonymous writes: @Mimi's Mum Logging into 10.63 has not affect, unfortunately. Standard view does work with 10.63, though. So that's good news. Really not sure what the deal is. I guess I'll have to wait until the devs come out with an official fix.

Zalex ;-) Zalex108 Sunday, November 14, 2010 1:20:48 PM

Originally posted by kyleabaker:

Kyle Baker 12. November 2010, 20:46

Originally posted by fearphage:

// ==UserScript== // @name hide faulty bind implementation // @include *://mail.google.* // ==/UserScript== delete Function.prototype.bind;

Is this userjs intended to fix the current gmail loading issue? If so, it doesn't seem to be working for me.

Works fine for me! (Remember to enable JS in Https) 10.70 Last Build! wink Thx!

mrd Sunday, November 14, 2010 9:28:32 PM

Came into work this morning and opened up Opera (11.0/1060) and Gmail (google apps hosted mail) is hanging.

Put in that little UserJS and enabled it on HTTPS and it still appears to be hanging.

I assume this is something that Opera is talking to Google about, prefer with a big stick? p

Mimi's Mum (MM)mimi_s_mum Sunday, November 14, 2010 9:42:00 PM

Originally posted by mrd:

I assume this is something that Opera is talking to Google about

Apparently it's a bug of some sort in Opera (presumably all 11 builds).

Originally posted by olak:

No, the Gmail load failure is unrelated to these experiments. The error lies in a faulty native implementation of Function.prototype.bind. Should be fixed soonish.


Gmail should load fine on 10.63 smile

Inf4mous Sunday, November 14, 2010 9:50:33 PM

just delete cookies regarding to google.com & mail.google.com and script will work

ncc50446 Sunday, November 14, 2010 9:55:11 PM

Thank you very much smile Didn't realize that CKEditor had been fixed.
Keep up the good work Opera Teams!

Balázs Bodóblasiotm Sunday, November 14, 2010 9:59:15 PM

Originally posted by fearphage:

Is there a test suite for a functional Function#bind? I worked around it by removing the faulty function:

// ==UserScript==
// @name          hide faulty bind implementation
// @include       *://mail.google.*
// ==/UserScript==

delete Function.prototype.bind;




how to use it? sorr for the silly question, but I created a text doc with the text you gave, renamed .txt to .js, enabled userjs, gave the folder for it and Gmail doesnt work.
O11 build 1060, Windows 7...

MyOpera team, please fix this!fearphage Sunday, November 14, 2010 10:19:35 PM

I just tried it on Ubuntu x64 and I never get the notification about "userjs on https" that I get on windows. So I don't think anything is happening at all.

I breifly was getting an error that looked like a regression about "-->" appearing in javascript.

Originally posted by blasiotm:

how to use it? sorr for the silly question, but I created a text doc with the text you gave, renamed .txt to .js, enabled userjs, gave the folder for it and Gmail doesnt work.

That all sounds right. have you tried enabling all of these:

opera:config#UserPrefs|AlwaysLoadUserJavaScript
opera:config#UserPrefs|UserJavaScript
opera:config#UserPrefs|UserJavaScriptonHTTPS


EDIT: Even after restarting Opera, I still don't get the "Userjs on HTTPS" popup.

Galileo Monday, November 15, 2010 9:17:12 AM

I'm trying to use in google analytics "In-Page Analytics Beta" But the page of the site opens with the error: Access denied. Please try relaunching site overlay from the report.
[Error: 20007]
and this js in error console

JavaScript - http://site*.blogspot.com/
Event thread: message
Uncaught exception: TypeError: Cannot convert 'd' to object
Error thrown at line 313, column 83 in <anonymous function: Q.getBubblePercentData>(a, b, c) in https://www.google.com/analytics/reporting/overlay_js?gaso=data12346565656
for(var d=a.getViewNames(),f={},g=j,k=a.getMetrics(),o=0,y;y=d[o];++o)
called from line 319, column 536 in <anonymous function: Q.drawBubble_>(a, b) in https://www.google.com/analytics/reporting/overlay_js?gaso=data12346565656
var c=this.linkAttributor_.getBubblePercentData(this.pageData_,a,b);
called from line 318, column 500 in <anonymous function: Q.markPage_>() in https://www.google.com/analytics/reporting/overlay_js?gaso=data12346565656
var g=this.drawBubble_(d,
called from line 342, column 382 in <anonymous function: renderData_>() in https://www.google.com/analytics/reporting/overlay_js?gaso=data12346565656
this.markPage_()
called from line 355, column 211 in <anonymous function: Q.onNewUrlResolutions_>() in https://www.google.com/analytics/reporting/overlay_js?gaso=data12346565656
this.renderData_()
called via Function.prototype.apply() from line 9, column 1007 in <anonymous function>() in https://www.google.com/analytics/reporting/overlay_js?gaso=data12346565656
return a[lc](c,
called from line 311, column 228 in <anonymous function: Q.registerRewrites_>(a) in https://www.google.com/analytics/reporting/overlay_js?gaso=data12346565656
b>0&&this.newUrlsCallback_(a)
called via Function.prototype.apply() from line 9, column 1007 in <anonymous function>() in https://www.google.com/analytics/reporting/overlay_js?gaso=data12346565656
return a[lc](c,
called from line 138, column 322 in <anonymous function: Q.deliver_>(a, b) in https://www.google.com/analytics/reporting/overlay_js?gaso=data12346565656
c.callback(b)
called from line 124, column 239 in <anonymous function>(a) in https://www.google.com/analytics/reporting/overlay_js?gaso=data12346565656
d.deliver_(c,b);


In the previews snapshot it was working ok. Is this related to the problem that Opera has with gmail?

idomagic Monday, November 15, 2010 9:31:45 AM

Originally posted by fearphage:

EDIT: Even after restarting Opera, I still don't get the "Userjs on HTTPS" popup.



Have you right-clicked on the site and checked the "Path to user JavaScript" under "Edit site preferences"/"Scripting"?

I have now tried the workaround on both 10.70 b9071 on winxp & ubuntu and latest o11 snapshot on w7, and it was working on all..

Ola P. Kleivenolak Monday, November 15, 2010 9:47:19 AM

@Galileo: easy to check, just let fearphage's user.js apply globally. Though if it worked in previous snapshot it sounds like something else. Same browser.js in the two?

Hallvord R. M. Steenhallvors Monday, November 15, 2010 11:41:52 AM

A reminder to those who have problems getting fearphage's GMail user JS to work: if you have set site-specific settings for GMail, you need to go into site prefs to set the user JS path too!

Galileo Monday, November 15, 2010 11:44:32 AM

Is this correct to add to the userjs ?
// @include *://google.*
I download snapshot 1055, with the latest browserjs "Current browser.js status: enabled.
Target version and time stamp of the active browser.js file is Opera Desktop 11.00 core 2.7.39, November 11, 2010 ." and it works ok. No error messages inside analytics.
The userjs of fearphage works in gmail.