savrus / uguu

Automatically exported from code.google.com/p/uguu
Other
3 stars 1 forks source link

Links to smbshares don't work well in Opera #81

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
We have 'file://///' at the beginning. Opera doesn't converge it to 'file://', 
so this has to be done by the code. The following patch fixes the issue, but 
maybe we should instead give 'file://///' for the Firefox only.

diff -r ae120fdfecbb webuguu/common.py
--- a/webuguu/common.py Sun Sep 19 19:31:26 2010 +0400
+++ b/webuguu/common.py Sun Nov 11 13:30:47 2012 +0400
@@ -104,19 +104,22 @@
     if protocol == "smb":
         if re.search(r'(?u)win(dows|nt|32)',
                 string.lower(request.META['HTTP_USER_AGENT']), re.UNICODE):
+           if re.search(r'(?u)Opera', request.META['HTTP_USER_AGENT'], 
re.UNICODE):
+                return "file://"
             return "file://///"
     return protocol + "://"

Original issue reported on code.google.com by ruslan.savchenko on 11 Nov 2012 at 9:33

GoogleCodeExporter commented 9 years ago
The idea was right, file:///// is necessary only for Firefox (and even the 
newest version requires it). IE, Opera and Chrome are happy with file://.
BTW none of them allows clicking such a link by default, but copying the link 
and pasting it into address line works. Also, IE and Chrome save the file when 
right-click on link and choose Save As.
Everything tested on Win7

Original comment by ruslan.savchenko on 11 Nov 2012 at 11:41