Detecting Firefox extension version - javascript

I have a Firefox Extension that I would like to populate the About box with the version within install.rdf.
I know that FUEL's extIExtension allows one to see the version for an extension but I did not create the extension using FUEL (and the docs on MDC seem very light on how to transition to it). Is there a way to dynamically check the extension version?
I specifically do not want to hard code or make it generated from my Makefile

#sdwilsh, you're right, my apologizes.
Took me awhile to realize the only FUEL object I have access to is fuelApplication, but it looks like this does it:
let version = Application.extensions.get('extension#id').version;

FUEL is just an API, so it doesn't matter how you implemented your add-on.

Related

Chrome doesn't support image insertion here

I've seen similar questions asked regarding Flutter and other applications, but to give some context, Google's Gboard just changed the way GIFs and emojis insert into the application, but it's unclear how to support it now.
The error above appears when using Gboard to insert an image into an HTML input. I assume there's some way to accept this, but there does not appear to be any documentation on this apart from the obscure change notes on Gboard that say they changed the way they do it.
This was probably fixed in the newest update by Gboard. You can install an APK of an older version of Gboard here and the easiest way to downgrade Gboard for iOS is using a tweak called AppStore ++ but that only works if you are jailbroken.
Otherwise, just try other keyboards such as SwiftKey or Giphy to insert the image into your HTML input.

Chrome Extension packing while developing - any better way?

I do some chrome extension (web music play/stop) as a hobby project.
At the moment my process is like this:
Disable chrome store version
Make changes
Pack extension
Remove previous version of extension
Drag'n'drop new dev version
When I think I'm done, I upload the final zip to the dashboard, remove dev version and turn back on the chrome store version.
So this looks quite hard and not rational. Guess there is another way to do it.
Maybe I've just missed a good part of the manual, please point me to.
Answer by #devnull69
You even don't need to disable the chrome store version because the
local / unpacked version will have a different extension id and can
easily be run in parallel to the webstore version
https://developer.chrome.com/extensions/getstarted#unpacked

Quick Test javascript snippet for browser compatibility

Just as we have http://www.sliver.com/dotnet/SnippetCompiler/ (link inactive on 2021-04-24) to test a C# code quickly, I can also do the same for javascript in chrome debugger tools and Firebug (firefox).
I would be more interested in a tool or some online tool which can run a small piece of javascript and tell if it properly runs in prominent browsers and the result.
UPDATE:
I'm a developer and not tester. I don't want to install all browsers on my PC. I like chrome and I can debug/test (for syntax/result) almost every javascript quickly in chrome by just clicking Ctrl+Shift+J and pasting my javascript in its console. But that will just test if it works in chrome. I'm not interested in creating a library right now. Google and Stackoverflow helps me get the greatest and latest javascript for a specific task very quickly.
I found one way. But it is not that quick and still would like to know better answer. May be some kind of tool which can do this.
One Way:-
Write your javascript enclosed in try-catch block on JsBin and create its public link. Now check your link with BrowserShots.
Write considerable amount of html (conditionally) using javascript to be able to see the difference on Images given by BrowserShots.
To propose another option 10 years down the line: I would suggest using JSHint for this.
The first page as you navigate to their site allows you to simply paste a JS snippet and get information regarding everything from potentially confusing syntax to "minimum ES version" warnings.
Furthermore, you can also install JSHint to your project and have a command to either run manually or slot into your existing build chain to do the same thing locally with custom rules.
I've also found this tool: JS Compatibility Checker, which is based on Can I use.
Could be helpful, but won't outline every issue.
You can easily make a test page to house your snippets, then try them in your target browsers. That has the added advantage of providing a central library for the snippets you do create, so you don't have to go hunting through entire directories looking for that cool little widget you created back in 2010.
Also, you can check the MDN Web Docs Browser Compatibility section if that interface is available (Eg. window.location - https://developer.mozilla.org/en-US/docs/Web/API/Location#browser_compatibility)

Firefox XUL toolbar with javascript to IE?

I have developed a Firefox toolbar in XUL, which uses javascript to manipulate the DOM.
I'd like to export this to IE.
I know that IE doesn't support XUL, but wonder:
(1) is there an easy way to use the existing javascript code for the IE toolbar as well?
(2) is there a IE installer that easily creates all necessary registry values for creating a toolbar?
I'd be grateful for any help. If anyone can point me to a sample IE toolbar code, with several buttons, drop-down menus and perhaps even a search box, that'll make things much easier as well.
Thanks!
Try AmpleSDK by using this you may port your toolbar to ie
Writing an IE toolbar requires C++, the Windows API and Microsoft COM. If you have the paid version of Visual Studio then you can also use ATL to simplify some of the work.
You won't be able to re-use your JavaScript code. Unless perhaps JavaScript code for manipulating the DOM of the currently loaded webpage.
This article is what got me started:
http://msdn.microsoft.com/en-us/library/bb776819.aspx
I found this to be a helpful sample.
I want to warn you though that creating an IE toolbar can be quite painful. If you are serious then I recommend that you learn and understand the basics of COM and ActiveX first. (I did not do this and spent many hours messing around getting nowhere.)
An alternative option would to embed XULRunner in IE. It would allow you to port most of your code. I have never tried this myself though.
Well the company www.softomate.com is focused on porting existing FF plugins to IE and other browsers. We were able to port my existing Security related plugin to IE and Safari with them.

How to create a Firefox add-on using Objective-C on Mac OS X?

More precisely my goal is to create an add-on (or plug-in?) which is able to communicate with my main Cocoa application using something like the NSDistributedNotificationCenter. I need to be able to inject JavaScript code into the current webpage and get return values from the JS calls when my add-on receives the request to do so by my main application. Then I need to pass the return values back to my main application for processing.
Alternatively if there is a simple way to call JS in the active Firefox webpage and get return values that would also do the job.
If you want more info on why I want to do this, you can look at my other question: How to send JavaScript code to IE using C# (.Net 3.5), run it, then get a string return value from the JS code?
Note that I'm not only interested in knowing how to make a Firefox add-on but also in everything I talked about above. For example, how to inject JS into the active webpage, etc.
I'd like guidance on what technologies to use, tutorials and sample code if possible. The best would be a sample Xcode project but I'm not counting on this :P
Thanks in advance!
N.B: I'm working on 10.4.
You could try using C-Types with FF, which is a regular dll being called by Javascript in your addon, this is WAY better approach that using XPCOM, because if the Interfaces you use in there can change in each FF version, indeed you will have to do multiple dlls each for your addon supported FF versions
Go here my friend->
https://developer.mozilla.org/en-US/docs/Mozilla/js-ctypes/Using_js-ctypes
First learn how to write add-ons for Firefox. Adding Objective-C code afterwards is the easy part.
I know there is source available to the OSX FF Plugins for displaying download progress over the Dock Icon (http://github.com/vasi/firefox-dock-progress) and the "pdf plugin" that allows FF to do in-line PDFs is on Google Code.

Categories

Resources