Modify

Opened 4 years ago

Closed 2 years ago

#8245 closed defect (fixed)

Plugin does not work with Chrome 7.0.517.44 on OS X

Reported by: kamil@… Owned by: jun66j5
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 4 years ago by jun66j5

  • Status changed from new to assigned

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 4 years ago by jun66j5

  • Resolution set to fixed
  • Status changed from assigned to closed

If you can reproduce it, please reopen the issue.

comment:3 Changed 4 years ago by kamil@…

  • Resolution fixed deleted
  • Status changed from closed to reopened

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

comment:4 Changed 2 years ago by kompiro

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 2 years ago by jun66j5

Thanks for yours reporting and patch!

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

comment:6 Changed 2 years ago by jun66j5

  • Resolution set to fixed
  • Status changed from reopened to closed

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.