GithubHelp home page GithubHelp logo

bhanditz / operaextensions.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from operasoftware/operaextensions.js

0.0 2.0 0.0 17.02 MB

Opera (.oex) Extensions JavaScript API Compatibility Layer for Chromium-based Opera 15+ (.nex) Extensions

License: MIT License

JavaScript 99.54% HTML 0.24% CSS 0.21% Shell 0.01% Batchfile 0.01% Python 0.01%

operaextensions.js's Introduction

Opera Extensions JavaScript API Compatibility Layer (operaextensions.js)

This library provides a compatibility Layer containing the JavaScript Opera Extension APIs that have been provided in Opera <= version 12.

This library is intended for use in the oex2nex convertor tool. If you want to convert an existing Opera oex extension into an Opera 15+ nex extension then you should download the oex2nex convertor tool directly rather than using this library standalone.

Supported Opera Extension APIs

This library adds support to Chromium for the following Opera (.oex) Extension APIs:

* minus support for addEventListener and removeEventListener UserJS events.

Further API reference documentation

The full Opera Extension (.oex) API Documentation is provided for reference in the /docs directory of this repository.

Download this library

You can download a ZIP or TAR.GZ file containing all the operaextensions.js library code or you can clone this repo via Git as follows:

git clone git://github.com/operasoftware/operaextensions.js.git

Building the libraries

Using utilities provided in this library we can build the compatibility library for the different contexts in which it can be used.

The latest builds are provided by default in the /build directory of this repository (see: the Opera Extension Compatibility Libraries section below). If, however, you would like to build these files yourself then the following instructions are for you.

The build utilities included in this library have the following dependencies that first need to be installed:

  • Python >= version 1.6
  • Java

To build the library from source change directories to the folder in which you cloned this repository and execute the follow code:

cd ./utils
./build.sh

(alternatively, we can replace 'build.sh' above with 'build.bat' if we are running on Windows).

The Opera Extension Compatibility Layer libraries

The following six final build files are provided in this repository:

Using the libraries in your own converted extension

Each library available in the /build directory of this repository needs to be included in to your extension according to the guidelines provided below.

Note: It is strongly advised that you use these library files via the oex2nex convertor tool only. The oex2nex convertor tool will parse and modify your existing Opera oex JavaScript code to run correctly under this compatibility layer. The following instructions are intended for debugging purposes only and do not cover the JavaScript code anomalies you will find if you attempt to run this in an unconverted oex extension.

Including the background process library in your converted extension
  1. Copy /build/operaextensions_background.min.js to your Opera oex extension's directory (to e.g. /oex_shim/operaextensions_background.min.js)

  2. Add a new <script> tag in your background HTML page as follows:

    <script type="application/javascript" src="/oex_shim/operaextensions_background.min.js"></script>
  3. Wrap all your existing Opera oex extension code in an opera.isReady function as follows:

    opera.isReady(function() {
       // your old OEX extension code goes here
     });
Including the popup process library in your converted extension
  1. Copy /build/operaextensions_popup.min.js to your Opera oex extension's directory (to e.g. /oex_shim/operaextensions_popup.min.js)

  2. Add a new <script> tag in all your popup HTML pages (including your options.html page if available) as follows:

    <script type="application/javascript" src="/oex_shim/operaextensions_popup.min.js"></script>
  3. Wrap all your existing Opera oex extension code in an opera.isReady function as follows:

    opera.isReady(function() {
       // your old OEX extension code goes here
     });
Including the injected script process library in your converted extension
  1. Copy /build/operaextensions_injectedscript.min.js to your Opera oex extension's directory (to e.g. /oex_shim/operaextensions_injectedscript.min.js)

  2. Add this path to the content_scripts directive inside your extension's manifest.json file as follows:

    "content_scripts": [
        {
          "matches": ["http://*/*", "https://*/*"],
          "js": ["/oex_shim/operaextensions_injectedscript.min.js"],
          "run_at":"document_start"
        }
    ]
  3. Wrap all your existing Opera oex extension code in an opera.isReady function as follows:

    opera.isReady(function() {
       // your old OEX extension code goes here
     });

Feedback

If you find any bugs or issues please report them on the operaextensions.js Issue Tracker.

If you would like to contribute to this project please consider forking this repo and then creating a new Pull Request back to the main code base.

License

Copyright © 2013 Opera Software ASA

See the LICENSE file.

operaextensions.js's People

Contributors

richtr avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.