Background in 2 points.
I like to read very much - to read on the e-book.
Moment 1.
I have this e-book
eMatic EB105 . The book reads text formats: PDF / ePUB / TXT / FB2 / HTM / MOBI / RTF. But there is one huge disadvantage of this book - there is no Internet connection in the book. And it turns out that you can not read online.
')
Moment 2.
I use the Maxthon browser. A good cloud browser (though in my opinion the Chinese one is, well, niche). It has the ability to add the most plugins (
addons )
As a result, the idea of ​​creating an add-on with which you can save the pages of a site (article) in the FB2 format, which can be “thrown” into an e-book, arose.
So, the
conditions of the problem: creating an addon for the Maxthon browser using the example of the add-on HTML_FB2. At what the addon will be sent to the site where you can convert text or page online. Want to write something cooler - please write.
Phew! I almost forgot - you need to register on the browser forum.
Plan
1. Skeleton addon in words and documentation.
2. Creating add-on definition file - def.json.
3. Addon packaging and testing.
4. Flooding addon browser resource.
Implementation of a plan
one.
The addon skeleton consists of 3 groups of files (icons \ - icons, locale \ - languages, other files \ - other files) + def.json add-on definition file.

Name Name_addon = html_fb2 (in my example)
The icons folder should contain files of the type Name_16.png, Name_32.png, Name_48.png - the number means how many pixels in the picture (16X16, 32X32, 48X48 px). In my example, I have the files icon_16.png, icon_32.png, icon_48.png. Which I created in a graphic editor - this will be the logo of our add-on. This folder is required.
The locale folder contains configuration files for different languages ​​like ru-ru.ini (Russian language), zh-cn.ini (Chinese language), de.ini (German language), etc. ... Looking at what user (in what language speaks and understands the user) calculated addon. This folder can not be created, because I did not have a binding to languages. In my example, this folder is missing from me.
Other files can not write if it is not necessary. I had no such need.
If you look at the addon more closely, the documentation is
here . Documentation in English - note.
In the file
Mx-Extension-SDK-1.0.6.zip .
2
Create a file called def.json. Open a text editor (I wrote in Sublime) and write the code
[
{
"Type": "extension",
"FrameworkVersion": "1.0.1",
"Version": "1.0.0",
"Guid": "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}",
"Name": "HTML to FB2",
"Title": {
"Ru-ru": "HTML to FB2",
"En": "HTML to FB2",
"Zh-cn": "HTML to FB2"
},
"Author": {
"Name": "",
“Email”: “@gmail.com”
},
"Actions": [
{
"Type": "panel",
"EntryPoints": [
Sidebar
],
"Main": " ebook.online-convert.com/convert-to-fb2 ",
"AllowPin": false,
"Resizable": true
"Width": {
"Default": 880
},
"Height": {
"Default": 300
}
}
]
}
]
Everything is intuitive and easy.
It makes no sense to sit and decipher every word. This is all there . In the file Mx-Extension-SDK-1.0.6.zip . I can only say one thing is that you can create a guid number on guidgenerator.com
3
After we created the files and edited the def.json. Download the packer again from here . It is in the MxPacker.zip file. Unpack it. After that, select the folder to export the addon. In my example, this is the html_fb2 folder and click Package .
We get our addon. In my example, I received the html_fb2.mxaddon file and click on the execution. I install in the browser and try how it works. After we like everything and the addon works, we proceed to the next step.
four.
Go to the website extension.maxthon.com/upload and upload the add-on " Upload Extension ".
Enter information about the addon, etc ... Go to the extension.maxthon.com/shared page and wait until the browser’s “command” check the addon and upload it for general download.
That's all folks!
PS At the time of this writing, the addon was downloaded to the browser site and waited for checking and sharing!