SimpleSelectSearch
SimpleSelectSearch copied to clipboard
More jQuery
Since already extension is including this library, some of the functions and operations might be rewritten to jQuery version.
Just a thought. Do you think it's worth it to load jquery on background? I remember my original idea was to avoid loading it there, only because it felt a waste. i am not sure how much are you planning on using it there. On the options page, I needed it for several pieces, and since it only loads when options page is opened, I didn't mind. But on background, it didn't seem necessary at the time and it loads every time you open your browser, am i right?
I wouldn't say it's a waste. First, take a look at this - http://stackoverflow.com/questions/9342131/chrome-extension-load-a-backgorund-js-each-time-the-page-reloads. Google Chrome extensions engine allows us to make two different types of background pages - persistent and event ones. Google suggest strongly using event ones, because they are loaded when needed and after use they are removed from memory. But, right now SSS uses persistent ones - which are loaded on opening a new window and stay in memory as long as window is opened. So, adding jquery to background will cause only ~95kb loaded to memory, once (assuming jquery 1.7.min). It's really insignificant amount of additional code and memory usage. Benefits from including? Well, I think if You decided to use framework or a library in SSS it's a good idea to use it everywhere it's possible and needed - jQuery is quite powerful library and resolves many "flaws" (which are not flaws in fact, but features of language that are pain in the... head when it comes to web scripting) of JS. And last but not least - consistent code architecture.
Separate subject is switching from persistant background page to event one. I didn't research if it's possible to event background pages affects context menus so SSS would work as it does right now. It should be possible (afterall it sounds reasonable), but this need to be researched. Anyway - even if event background pages are capable of affecting context menus in tabs, I wouldn't scold out including jquery in them :)
http://developer.chrome.com/extensions/event_pages.html - just looked at point 7 ;) they are capable to affecting context menus :)