How To Create A Simple Opera Addon

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How To Create A Simple Opera Addon

    Creating opera addons is easy..

    first start by making a called config.xml and put this inside of it:
    PHP Code:
    <?xml version="1.0" encoding="utf-8"?>
    <widget xmlns="http://www.w3.org/ns/widgets" id="http://your-site.con">
        <name>My First Addon v1.0</name>
        <description>Learning Addons :D</description>
          <author href="yourURL" email="your@email.con">Your Name</author>
          <icon src="icon64.png"/>
    </widget>
    edit the above text as you want it.... can use a fake email address if you want to

    Save it and create 2 images icon64.png which has to be 64x64 pixels and icon18.png which has to be 18x18 pixels

    next create a file called index.html
    PHP Code:
    <!doctype html>
    <
    html lang="en">
      <
    head>
        <
    script>
           
    window.addEventListener("load", function(){
            var 
    theButton;
            var 
    ToolbarUIItemProperties = {
              
    title"Your Title",
              
    icon"icon64.png",
              
    popup: {
                
    href"popup.html",
                
    width210,
                
    height330
              
    }
            }
            
    theButton opera.contexts.toolbar.createItem(ToolbarUIItemProperties);
            
    opera.contexts.toolbar.addItem(theButton);
          }, 
    false);
        </
    script>
      </
    head>
      <
    body>
      </
    body>
    </
    html
    you can change the width and hieght to what ever size you need it ;)


    next create a file called popup.html
    PHP Code:
    <html
    <
    head
    </
    head
    <
    body
    <
    center
    <
    h3My First Addon </h3
    Some More Text Here<br/><br/> 
    </
    center
    </
    body
    </
    html
    Now You have finished saving all your files into the same place...

    if you want to just test it out at first you can just drag the config.xml onto opera and it will add your addon to the toolbar
    (remember to right click on your addon and refresh if you make any changes to it.)

    now to create the opera addon for others to use:
    highlight all the files by either dragging your mouse around them or pressing Ctrl A if there is no other files in there that shouldn't be there.
    then right click and send it to a zip file ..
    Make sure you zip all the files together (do not put the folder containing the files into the zip)

    once done rename the zip file to MyfirstAddon.oex
    (if cant rename the format (zip to oex) search google "how to show file formats")

    next drag it onto your opera and install it and make sure it works before sending it out to everyone

    Any questions feel free to ask in this topic
Working...
X