Abrowser's source code editor (Orion) doesn't work

Projet:Trisquel
Version:6.0
Composant:Programs
Catégorie:Rapporter un bogue
Priorité:normal
Attribué:Non assigné
Statut:closed
Description

Since some time you can't edit code using Abrowser's developer tools. If you run Abrowser's Scratchpad (Shift + F4) it displays a grey box.

If you use Firebug, which is an alternative to Abrowser's developer tools, it also won't work as expected. In Firebug's Console tab, if you press the "Show Command Editor" button, which is on the right side of the command line, it will also display a grey box.

If configure Abrowser via about:config, you can disable the editor Orion for Firebug, which enables you to use it's command editor, although it's now replaced with a very basic editor.

I've tested this on two computers. Both had this issue. One of the computers is running Abrowser 20. It would help if some of you report if you have the same issue.

mer, 05/15/2013 - 04:51

Same here on two different computers, one 32 bits, the other 64 bits.

When I want to edit a greasemonkey script by right clicking on the script in the Add-ons Manager / User Scripts I also get a grey box in Scratchpad.

A solution is to select "Show containing folder" then opening the file with an editor, not so handy but it works.

mer, 02/12/2014 - 03:07
Statut:active» patch (needs review)

I figured out the cause of this bug. Some javascript code (browser/devtools/sourceeditor/orion/orion.js) for Orion checks for the useragent. In Firefox, it checks (at line 3426) whether your user agent contains the string "Firefox." However, because of the package helper, Abrowser checks for the string "Abrowser". This results in incorrect behavior, since the user agent of Abrowser is restored to one containing "Firefox" by the package helper.

You can easily see that this is the problem. Go to about:config. Add a string called general.useragent.override. Enter the following string:
Mozilla/5.0 (X11; Linux x86_64; rv:26.0) Gecko/20100101 Abrowser/26.0
Then press Shift-F4, and the scratchpad will indeed work!

Just add this code to the package helper:
sed -i 's/Abrowser/Firefox/g' browser/devtools/sourceeditor/orion/orion.js

I guess this is fine, since the only instances of Firefox in the original version of that file are comments and the isFirefox variable, and nothing to do with branding.

sam, 02/22/2014 - 04:56

I think this would be better, just replacing the string checked for in the user agent.

sed -i 's/"Abrowser\/"/"Firefox\/"/g' browser/devtools/sourceeditor/orion/orion.js

sam, 03/22/2014 - 00:21

No longer an issue in Abrowser 28, because Mozilla replaced Orion with Codemirror. How do I change the status to fixed?

dim, 03/23/2014 - 20:05
Statut:patch (needs review)» fixed
dim, 04/06/2014 - 20:10
Statut:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.