Firefox self-write bottom-level extension, Introduction to source code

Source: Internet
Author: User

Remember 10 time, then began to like JS, often stroll MDN

Start to write some simple oil monkey script, slowly contact with the expansion of development, found that with their own JS knowledge plus Firefox plug-in API, you can complete a good multi-function.

Read a lot of plug-in source code, integration of many plug-in features, the code is also refactored several versions (based on the FF function, Components.utils.import encapsulated require module loading, SQLite database operation, HTTP interception, scheduled tasks, Prefs operation, etc.)

Also found that the FF plug-in is actually very insecure (can intercept HTTP requests for modification, man-in-the-middle attacks)

It's been written for 2 years without realizing it.

Later FF also has a set of API toolkit, I also mainly through the Aauto writing related desktop programs, and never updated

Close Up this blog post, documenting the plugin API features that have been written

GitHub Project Address: Https://github.com/legu2009/UserJS

The plugin is the base API package, via Overlay.xul, inserts a script node reference at the chrome level

A brief introduction to the next folder and function, time is too early, and some of the moment is not up

|-content//Plugin content folder

|-datebase

Datebase.js//sqlite Database Operations

|-img

canvas.js//get an image of Base64 data or save the page as a picture

|-io (this uses less, some may API, just the rewrite of other plugins)

_file_base.js//System File Descriptor

dir_utils.js//folder Common functions

file.js//file Operations

file_base.js//file Operations

|-network

Ajax.js//ajax Functional Package 1.0

Ajax2.js//ajax Functional Package 2.0

cache.js//Browser Memory Control

cookies.js//Browser Cookie Control

Http_observer.js//http Request for monitoring

proxy_observer.js//Browser proxy settings

pop.js//based on Pop,socket and server communication

smtp.js//based on Smtp,socket and server communication

serversocket.js//server-side socket code

socket.js//Client Socket

|-other

Saved plug-in code

|-server

httpd.js//httpserver//from other projects

|-userjs//'s own script, more powerful, involves security issues that can be used for hacker technology

Network

Ajax3.js//ajax Functional Package 3.0

cookie_manage//Browser Cookie management, combined with database (can be long vest browser)

cookie_manage_and.js//Browser Cookie Management, no database

Http_observer.js//http Request response interception, monitoring, can be modified to return, or make a return file

http_observer-53.js//A previous version of the Save

info_manage.js//Account Information Management

opts_manage.js//Database Initialization

|-utils

_timer.js//Browser-level Timer API encapsulation

clear.js//empty browser cache function (cookies, history, flash, etc.)

config.js//Open Java,js function

dateformat.js//time Formatting

group.js//Group Management (for scheduled tasks, timing)

Jsbeautify.js

path_manage.js//path management, resource files and actual file paths, and other related functions

post.js//timing Task system, mainly developed a multi-account grab floor logic

prefs.js//Configuring Prefs Management

RSA.JS//RSA encryption

timer.js//Timer

worker.js//Multi-task management, scheduled task management

util.js//Common libraries (MD5, iterators, load scripts, encoding transforms, browser prompts, switch IP by tuning process)

init.js//inserting Chrome's initialization file

options.json//Configuration Short path configuration file, mainly used for require

overlay.xul//plugin loading, modifying the information of Chrome elements XUL file

|-defaults//Plugin multi-language information such as folders

Chrome.manifest//FF Registration Resource File

Install.rd F//FF Plugin Information file

Firefox self-write bottom-level extension, Introduction to source code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.