Copy to clipboard not working

Post information about bugs here

Copy to clipboard not working

Postby trespassersW » Sun Oct 16, 2016 10:07 am

tested on Fx49, Custom Buttons 0.0.5.8.9,
trying r-click on custombutton -> Copy to clipboard
info from browser console:
Code: Select all
==============
NS_ERROR_UNEXPECTED:
custombutton.xmlFormatURI()
cbbutton.js:213
custombutton.buttonGetURI()
cbbutton.js:232
<anonymous>
cbbuttonimpl.js:85
custombuttons.copyURI()
overlay.js:401
oncommand()
browser.xul:1
cbbutton.js:213
===============
error raised in the following string (cbbutton.js:213):
===============
      var doc = (new DOMParser()).parseFromString(templateStr, "application/xml");
==============

So, it seems like new Mozilla DOMparser refuse to parse new CB XML data.
trespassersW
 
Posts: 12
Joined: Fri Aug 12, 2016 4:42 pm

Re: Copy to clipboard not working

Postby Odyseus » Sun Oct 16, 2016 10:54 am

Hello, trespassersW.

That's a known issue. The Custom Buttons extension hosted on AMO (addons.mozilla.org) is broken on all Firefox versions greater than 48.
Odyseus
 
Posts: 434
Joined: Sun Mar 10, 2013 12:51 pm

Re: Copy to clipboard not working

Postby trespassersW » Sun Oct 16, 2016 5:48 pm

Afraid it's very well known problem. Last version of Ffx where i saw the 'clipboard copy' working was dated Ffx37.
:) So I wonder how Sonny managed to publish new versions of his script..
trespassersW
 
Posts: 12
Joined: Fri Aug 12, 2016 4:42 pm

Re: Copy to clipboard not working

Postby Odyseus » Mon Oct 17, 2016 4:22 am

Just install the extension attached to the second message of the topic that I linked and the copy to clipboard will work again.
Odyseus
 
Posts: 434
Joined: Sun Mar 10, 2013 12:51 pm

Re: Copy to clipboard not working

Postby trespassersW » Wed Oct 19, 2016 10:11 am

think I found a way to fix the error::
change line 213 in cbbutton.js to
Code: Select all
var doc = (new content.DOMParser()).parseFromString(templateStr, "application/xml");

i.e. we must clearly specify content window as parent of DOMParser.
Tested and working in Fx49.0.1.
trespassersW
 
Posts: 12
Joined: Fri Aug 12, 2016 4:42 pm

Re: Copy to clipboard not working

Postby Odyseus » Wed Oct 19, 2016 10:53 am

Hello, trespassersW.

content doesn't exists with multi-process enabled (it's always null);
Odyseus
 
Posts: 434
Joined: Sun Mar 10, 2013 12:51 pm

Re: Copy to clipboard not working

Postby trespassersW » Wed Oct 19, 2016 11:07 am

Probably more correct code:
Code: Select all
var doc = (Components.classes["@mozilla.org/xmlextras/domparser;1"]
          .createInstance(Components.interfaces.nsIDOMParser))
          .parseFromString(templateStr, "application/xml");
trespassersW
 
Posts: 12
Joined: Fri Aug 12, 2016 4:42 pm

Re: Copy to clipboard not working

Postby trespassersW » Thu Oct 20, 2016 3:18 pm

hi Odyseus
have you tested this patch in multi-task fx?
[EDIT] But there should be some sort of replacement for content window in multi-process-Firefox?
Last edited by trespassersW on Sat Nov 05, 2016 11:35 am, edited 1 time in total.
trespassersW
 
Posts: 12
Joined: Fri Aug 12, 2016 4:42 pm

Re: Copy to clipboard not working

Postby Odyseus » Fri Oct 21, 2016 11:25 am

Hello, trespassersW.

If you read the post where I reported this error, you will see that the nsIDOMParser service is used by the extension hosted on AMO. And the use of this service is the responsible of breaking the DOMParser method globally. That's why I switched to directly use the DOMParser method. I just tested it again and the problem still exists.

Relating to your original problem, you must have an extension or a button that uses the nsIDOMParser service, and that's what causing the DOMParser error (I'm just guessing).
Odyseus
 
Posts: 434
Joined: Sun Mar 10, 2013 12:51 pm

Re: Copy to clipboard not working

Postby trespassersW » Mon Oct 24, 2016 11:18 am

seems I found the causer of error -- ErrorZilla Plus add-on.
{EDIT} In fact, this add-on isn't doing anything wrong, but it calls this unfortunate function nsIDOMParser.parseFromString everytime when browser opens a new page.
trespassersW
 
Posts: 12
Joined: Fri Aug 12, 2016 4:42 pm


Return to Bug report

cron