The My Opera forums have been replaced with forums.opera.com. Please head over there to discuss Opera's products and features

See the new Forums

Extensions' buttons removal

Forums » Opera for Windows/Mac/Linux » Opera for Windows

You need to be logged in to post in the forums. If you do not have an account, please sign up first.

Go to last post

20. October 2011, 16:30:16

kalder

Posts: 92

Extensions' buttons removal

Hi,

I like Opera extensions so much. However, some extensions are just creating a new button on the upper right corner (right next to the address/search bar). I would like to remove some of these buttons. Some of them are inherently needed for the functioning of the ext., but others are not (e.g. fast search does not really need to have its button there).
I have checked around the web, there seem to be a way to move the "extension buttons" bar from there, to make it available "on demand" though another button, but no way just to select which buttons should show there...
Any help?

Thanks

kalder

28. October 2011, 19:47:54

spadija

Posts: 1643

Unfortunately, removing the extension button while keeping the extension requires editing the extension itself. If you really want to do this, close Opera, then go into %LocalAppData%\Opera\Opera\widgets (I don't know where extensions are stored on Linux/Mac) and find the .oex file that corresponds to the extension you want to edit. Now:
  1. Copy the extension file somewhere else so you can work on it, and change its extension from .oex to .zip.
  2. Unzip the extension and open its index.html in a text editor.
  3. If you see anything that looks like "opera.contexts.toolbar.createItem" in this file, skip to the next step. Otherwise, check the <script> elements in the file for the locations of other script files. Check those script files for "opera.contexts.toolbar.createItem".
  4. Once you've found the line that says "opera.contexts.toolbar.createItem( some stuff goes here );", put double forward slash (//) in front of it to comment it out. If it spans multiple lines like this:
    opera.contexts.toolbar.createItem({
        some: parameters,
        are: here });
    , comment out all the lines like so:
    //opera.contexts.toolbar.createItem({
    //    some: parameters,
    //    are: here });
  5. If you have a complex extension like my Text Shortcuts that adds and removes its button dynamically, you may need to comment out "opera.contexts.toolbar.createItem" lines in multiple places.
  6. (Optional) To test that the extension works, start Opera, disable the original extension, then drag the "config.xml" file from your unzipped extension on to Opera. This installs the extension in developer mode, so you can make changes to the extension's files and reload the extension easily. If it works, uninstall the developer mode extension and close Opera.
  7. Save the modified file(s) and zip everything back up. Change the archive's extension from .zip back to .oex.
  8. Replace the original .oex file with your newly modified one. Start Opera back up. Enjoy!

29. October 2011, 11:35:31

kalder

Posts: 92

Thank you! I tried my best and got to point 6 but the modified extension in developer mode does not work.
The extension's button I would like to remove is fast search (a lovely extension!) since I think the settings of the button should be available only in the manage extension page... I edited the index.html but maybe I have forgotten any other file (I admit I did not catch your suggestions at point 3 about other script elements...

Thanks again...

kalder

29. October 2011, 16:48:27

spadija

Posts: 1643

If it doesn't work in developer mode, you can press Ctrl+Shift+O to open the error console. Switch the box in the lower left from "All" to "JavaScript" so you only see script errors, then try reloading the extension. If you see any errors, then your modifications broke something else.

Also, could you post a link to Fast Search's extension page? I or someone else might have better luck modifying it.

29. October 2011, 17:25:24

kalder

Posts: 92

I tried but found no error in the error console. I mean, I put the edited extension in developer mode. Try to activate the extension (highlight text in any webpage, hit "s" and a background tab should appear with the highlighted text searched in google) and nothing happens..even in the error console... sad

31. October 2011, 03:53:26

spadija

Posts: 1643

Whoops. Sorry, it's "opera.contexts.toolbar.addItem" that needs to be commented out. Commenting out line 35 of index.html seems to work for me.

31. October 2011, 18:33:34

kalder

Posts: 92

Hei,

I have just tried once more. I have eited the index file as follows:

//opera.contexts.toolbar.addItem(button);

Nothing has changed in the developer mode...sorry. No button icon, but also no fast search!
What text editor are you using? Is that the only line you are commengin out? Should I leave any space or something (I am not expert in this)?

Thanks

kalder

1. November 2011, 06:09:47

spadija

Posts: 1643

I'm using Notepad++ and that's the only line I commented out. Try this. I didn't test it in Opera 11.52, but it works for me in 12.00 alpha.

1. November 2011, 14:19:20

kalder

Posts: 92

Great! It works!
Thanks,

kalder

Forums » Opera for Windows/Mac/Linux » Opera for Windows