Opera Dragonfly offline: a small full guide

Now, few people ask the question: "But how will this thing work without the Internet?" Even less are those for whom the autonomous work of a program or tool is an important part of the work process. And very few people would like to get Opera Operafly debugger under Opera 12 Presto offline.

My friends, this little manual is for all of you. And if one seems to be quite entertaining, but for others it is already a past stage, then for others it will be a revelation. Curious, of course, also well under the cat.

Opera Dragonfly Local

First of all, briefly,

How it all began

On one of the fateful days of the calendar, namely, on October 31, 2013, Opera Software ASA announced the closure of the My Opera service by March 1, 2014.
All that is left at the moment from my.opera.com is a redirect to the www.opera.com/ru/whereismyopera page with an eloquent cry in the URI of our pain: “Where is my Opera? !!”.
Some facts:

Opera Presto is actually still quite a good browser, especially for modest machines. But this “still” in the context of “still working” for Opera Dragonfly in the light of the company's effective policy makes it very high the chance that one day you will be left without a debugging tool. And then on this light browser, the diggers will rush in with the trebled force. Although, IMHO, and if you honestly, the modern content of the Internet and the little finger IE8 is not worth it. Not that of the Opera.

On this lyric part is over.

How to make Opera Dragonfly available locally

I am writing in the context of Windows 7 64bit OSes. But it will be fair for any Windows, and for the most part and for other axes.

Common beginning

1. Open opera: config URL in Opera 2. Look
for “dragon” in the search field
3. See the “Developer Tools URL” option. The default is https://dragonfly.opera.com/app/
4. Create a folder where you want to store your local Opera Dragonfly cherished. For example C: \ Opera \ dragonfly.

Then there are three working ways.
It was possible, of course, to limit oneself to the first one or to the optimal one, but for completeness of the exposition and the picture I describe all the possibilities found.
As the most correct and simple I advise the 2nd way, numbered under the letter B) .

A) - The first visible path, in the forehead.

5. Open the link dragonfly.opera.com/app in the same Opera 12
6. We see a message like "Waiting for a node to connect to port 0"
7. We do not pay attention to it, press Ctrl + S, in the dialog select "File name" = "Dragonfly", "File Type" = "XML file with images." We save.
8. In the folder where you saved, we see the file “dragonfly.xml” and the folder “dragonfly_files”.
9. Move to C: \ Opera \ dragonfly \ dragonfly.xml file and the dragonfly_files folder.
10. Rename dragonfly.xml to client-ru.xml
11. Write the value “file: // localhost / C: /Opera/dragonfly/client-ru.xml” in opera: config “Developer Tools URL”

B) - Shorter and more beautiful way.

5. Go to the not yet killed repository of assembled zip versions of Opera Dragonfly: dragonfly.opera.com/app/zips
6. Go to the default zips - latest and download the desired localization of dragonfly. I downloaded client-ru.zip and client-en.zip
7. Unpack client-ru.zip in C: \ Opera \ dragonfly \. We get in the root of this folder the file client-ru.xml and two subfolders.
[7.1] It is possible to unpack directly to the same place and other localizations, for example client-en.zip, this is compatible. According to the scripts and xml, the content of the archives is not intersected, and the css is the same for all locales.
8. We register in opera: config “Developer Tools URL” the value of “file: // localhost / C: /Opera/dragonfly/client-ru.xml”

PS: As the good commentator here suggests rb.labtodo.com/page/use- opera-dragonfly-offline, you can not even unpack the archive, but directly in the form of an archive and leave it by writing something like in the Developer Tools URL file://localhost/c:\opera\client-ru.zip/client-ru.xml. Opera can work with zip archives as with directories.

C) - The path of this warrior

5. Go to the not yet dead repository (there are forks!) Github.com/operasoftware/dragonfly . Clone / download zip.
6. (crossed out) Reedmi us carefully suggests that Dragonfly (Dragon Fly) is going to be a miracle-assembler DragonKeeper (Dragon Keeper) - github.com/operasoftware/dragonfly-build-tools . Clone / download zip.

As it turned out, DragonKeeper can collect, well, surely, and cool stuff, and not only collect ... But for the purpose of “gathering a dragonfly from a surse”, it is not really necessary. Since Dragonfly has its own Python collector with support in the / tools subfolder.

But if anyone decides to continue the Dragonfly development under the Presto Opera, local manuals and Dragonflies, and Keeper will tell you a lot of useful things.

6. We swing pythons. www.python.org/downloads I will remove the piece under the spoiler, in short, 2.6. * - 2.7. *.
The story of cones on pythons
Сначала интуиция подсказывала мне, что стоит взять Python 2

Пробуем собрать под Python 2.7.11

И тут на тебе, UnicodeEncodeError: 'ascii' codec can't encode character u'\u2026'
Потыркал немного, сказал, что я так не играю, и пошёл за другим питоном.

Пробуем собрать под Python 3.5.1

>python tools/dfbuild.py -dtsm src build
File «tools/dfbuild.py», line 393
except (IOError, os.error), why:
SyntaxError: invalid syntax

И далее-далее-далее.
Любой гуглозапрос скажет вам, что это одно из характерных проявлений несовместимости кода под 2-й питон под интерпретатором 3-го питона. Например можно полюбопытствовать тут — sebastianraschka.com/Articles/2014_python_2_3_key_diff.html

Кода вроде немного в питонячьих скриптах сборки Стрекозы…
Ради спортивного интереса, я было попробовал в полуручном режиме натравить регэкспы на сурсы:

except (.*)?, (\w+):
except \1 as \2:

raise\s+(.*)?, (\w+)
raise \1\(\2\)



Оно всё равно легло, но уж совсем с непонятной мне, новичку в питоне, ошибкой, и тут я окончательно понял что что-то я делаю не так :)
Предварительно, я конечно забэкапил исходное состояние папки /tools. Восстановил его и решил чуть попристальней попробовать собрать под 2-м.

Пробуем собрать под Python 2.7.11, попытка 2.

File "tools/dfbuild.py", line 458, in _convert_imgs_to_data_uris
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2026' in position 12: ordinal not in range(128)

Ладно… google, stackoverflow,…

Попробовал поменять методом тыка «ascii» на «utf-8»:
File "tools/dfbuild.py", line 465, in _convert_imgs_to_data_uris
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 126562: ordinal not in range(128)

И ещё несколько попыток методом «Угадай Мелодию».

И тут я вернулся к началу, — а что за символ-то \u2026?
Ellipsis… так значит, многоточие говорите.
А код, который валится у нас, отвечает за обновление css-ки билда Dragonfly в процессе встройки туда base64 картинок.
И что там в необновившейся /style/dragonfly.css?
Ага!!! И правда, есть там оно, символ многоточия! В бинарной utf-8 кодировке.
(Кстати, как потом выяснилось, там ещё есть пару символов длинного тире)

И я нашёл как починить процесс билда! Только это уже вынесу из под спойлера наружу. Итак:

In its original form, the python-script does not want to collect the Dragonfly.
In order to work, it is necessary to pofiksit tools / dfbuild.py 458-th row with at the usefulness of the information for reflection has provided the dock docs.python.org/2/howto/unicode.html Next team to assemble it is successful: You can clone a master of my fork github .com / FlameStorm / dragonfly already with this fix. In the official threw a pull-request. I note that Dragonfly is going for quite some time. And most of the work falls on the minification of js for each locale. 7. Dragonfly gathered in the newly created subfolder / build. We take from there the files client-ru.xml, style / dragonfly.css, script / dragonfly-ru.js 8. It’s already unnecessary to explain the rest to the warrior.

temp.write(line.encode("ascii", "xmlcharrefreplace"))

python tools/dfbuild.py -dtsm src build


Opera Dragonfly Local works!

It's alive, alive!

All three methods work.
And yes, it was fascinating!

PS: Reach your hands before publishing this small mana helped, already and unexpectedly, the release of the Opera 12.18 update .

PPS: In conclusion, I ’ll mention the long awaited release of Vivaldi for many - a ray of light in the dark kingdom! Thanks to the old-new team led by Jon von Tachner and separately for the coverage of events Ilya Shpankov - warm greetings to you and success!

Also popular now: