Modify

Opened 6 years ago

Closed 5 years ago

#8245 closed defect (fixed)

Plugin does not work with Chrome 7.0.517.44 on OS X

Reported by: Kamil Kisiel Owned by: Jun Omae
Priority: normal Component: TracDragDropPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description

As advertised is it should work with Chrome 4+, but it doesn't seem to work Chrome 7.0.517.44. The drag-and-drop enabled message only appears when I test with FireFox.

Attachments (0)

Change History (6)

comment:1 Changed 6 years ago by Jun Omae

Status: newassigned

Which revision of the plugin do you use? In [9288], I fixed the problem that does not work with Google Chrome 6+. If possible, try the latest.

comment:2 Changed 6 years ago by Jun Omae

Resolution: fixed
Status: assignedclosed

If you can reproduce it, please reopen the issue.

comment:3 Changed 6 years ago by Kamil Kisiel

Resolution: fixed
Status: closedreopened

Sorry for not answering earlier. We're using r9355, so it seems the fix in r9288 didn't do it..

comment:4 Changed 5 years ago by Hiroki Kondo

Now, Chrome was dropped gears and the browser doesn't have xhr.sendAsBinary() method.
See http://code.google.com/p/chromium/issues/detail?id=35705 .
So I made a simple patch to fix it.

Index: tracdragdrop.js
===================================================================
--- tracdragdrop.js	(revision 11504)
+++ tracdragdrop.js	(working copy)
@@ -3,6 +3,16 @@
         setup: function() {
             new FileReader();
             var xhr = new XMLHttpRequest();
+            if (window.navigator.userAgent.toLowerCase().indexOf("chrome") > -1) {
+                    XMLHttpRequest.prototype.sendAsBinary = function(datastr){
+                    function byteValue(x){
+                        return x.charCodeAt(0) & 0xff;
+                    }
+                    var ords = Array.prototype.map.call(datastr, byteValue);
+                    var ui8a = new Uint8Array(ords);
+                    this.send(ui8a.buffer);
+                }
+            }
             return xhr.upload && xhr.sendAsBinary ? true : false;
         },
         createXMLHttpRequest: function(options) {

comment:5 Changed 5 years ago by Jun Omae

Thanks for yours reporting and patch!

The issue is fixed in [11505]. Please try the latest.

comment:6 Changed 5 years ago by Jun Omae

Resolution: fixed
Status: reopenedclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.