BS-Harou

Just another blog about the best browser - Opera!

Subscribe to RSS feed

Posts tagged with "javascript"

Modular injected scripts in extensions

, , , ...

Recently in one of my blog posts I mentioned great library Require.JS. It has an API to load JavaScript snippets as modules. It works really great with popup files or with background file in speed dial extension.

Unfortunately, you can't use it in injected scripts for several reasons.
  1. Require.JS loads the snippets with script tags and we don't want to add any script tags to every page when our extensions is running.
  2. Even if it wouldn't be a problem we still can't load scripts from our extension package with script tag.
  3. Script tags also has it's own browser scope without the special Opera Extension APIs.
The conclusion is that Require.JS is useless when it comes to injected scripts. What we can do is to split our script to several injected script files. But such files have to use global scope to communicate and they are executed in alphabetical order.

Luckily, latest snapshot of Opera 12.50 Next has the new Resource Loader API. It is just one function which returns reference to "File" object of any file in our extension oex package.

Read more...

UserJS - External scripts v1.1

, ,

I create extensions from this userJS, you can downlod it here:

https://addons.labs.opera.com/addons/extensions/details/external-scripts/1.0/?display=en

My own AJAX Library? Yes please =)

, ,

I was looking for some good AJAX library, but I haven't found any suiting me. jQuery is too big and it's really not good idea to add it to web site just for AJAX. YUI is to complicated and it take me very long time until I was even able to realize which plug-in download. jx excess is quit good, but still not good enough. The only solution was to create my own library and here it goes:

Devilia AJAX Library v3.4
Library: http://is.gd/dEmoH
English documentation: http://is.gd/dEpPC
Czech documentation: http://is.gd/dEmps

Advantages:
- Only 2kb size
- Minimal global pollution (only global object is AJAX)
- Timeout function that prevents you against NSL
- Front function that enables you to send more connection requests at once
- Fast performance
- Professional code
- Separate callback for success and for errors
- Works in Opera, Chrome, Firefox, Safari, Internet Explorer 7+

I think this is the BEST AJAX Library! What do you think?
May 2013
M T W T F S S
April 2013June 2013
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31