How can I convert a Greasemonkey script into a restartless Firefox addon? - javascript

I need to convert a Greasemonkey script into a restartless Firefox addon.
It used to be possible to do this very easily using the Scriptify extension, but the extension has not been kept up to date with the latest changes to the Firefox browser, and no longer works.
Is there an alternate way to accomplish this?

It turns out, the developer of the Scriptify extension has updated his extension for compatibility with the newer Firefox browsers. Hooray! :)
UPDATE Now that Firefox has implemented the WebExtensions API for Firefox Extensions, it means its very easy to create restartless Firefox extensions from Greasemonkey scripts, as Firefox extensions built with the "Web Extensions" API are by default restartless, and you can include the gm script as a content script in the Firefox extension.
For an example of how to create a Firefox Extension using the new WebExtensions API, see here: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Your_first_WebExtension

Related

Is there types for MS Edge as there is for Chrome?

Google Chrome has #types/chrome for extension developing. Is there same thing for MS Edge? I find some mismatches between chrome and edge browsers and was hoping that types could help a bunch.
You don't need it. Edge is based on Chromium, and the same Chromium extension can be submitted to the Edge extension store.
https://learn.microsoft.com/en-us/microsoft-edge/extensions-chromium/
If you've already developed an extension for another Chromium-based browser, you can submit it to the Microsoft Edge Add-ons website. You don't need to rewrite your extension, and must verify it works in Microsoft Edge. When you migrate an existing Chromium extension to other Chromium browsers, make sure the same APIs or alternatives are available for your target browser.
For compatibility, make sure the API you use is supported by Edge (Supported APIs for Microsoft Edge extensions)

JS ActiveXObject On Chrome

I have Old ASP Project that depends on ActiveXObject
and now I want to make my project cross-browser and work on chrome in additional to ie
Can I Find any Plugin that makes chrome support ActiveXObject
Note I tried to use DOMParser() instead of ActiveXObject but it's not working fine
ActiveX is only supported by IE - the other browsers use a plugin architecture called NPAPI. However, there's a cross-browser plugin framework called Firebreath that you might find useful.
Chrome doesn't support ActiveXObject. You could use IE Tab in Chrome.
IE Tab exactly emulates IE by using the IE rendering engine directly within Chrome. This will enable you to use ActiveX controls and test your web pages with different versions of IE.

how to use window.crypto.signText?

i want to sign in Mozilla Firefox using a smart card. is there any java script code, running in Mozilla Firefox, where we can use window.crypto.signText to sign some text.
should we use addon or extension to do this task. i heard that crypto api's and window.crypto.signtext is disabled from Firefox version 33. Is there any alternative for signing done in Mozilla Firefox?

Is greasemonkey a built-in extension of Google's Chrome?

I'm trying both greasemonkey and Google's Chrome extensions. And found that Chrome seems to be using the same API names as GM. (I seem to be having the same bug...)
Just wondering whether greasemonkey is already a Google Chrome extension?
Yes, I believe you can just add Greasemonkey scripts and Chrome installs them as an 'extension' like all the other native extensions.
Checkout this article:
http://lifehacker.com/5461675/chrome-4-supports-greasemonkey-userscripts-without-an-extension
Note, however that some scripts seem to be supported on GreaseMonkey for Firefox only and can be a little buggy in Chrome. I'm not sure of the exact differences in implementation.
Simon.
#Simon pretty much hit it, but I wanted to make sure that this point is super-clear.
Google Chrome supports Greasemonkey scripts natively, using the same API so as to make existing scripts compatible. There's no Greasemonkey extension required.
Yes, Chrome supports userscripts but not fully as Greasemonkey. For example check out this userscript
Docs Online Viewer: http://userscripts.org/scripts/show/127774
It works well with Greasemonkey (in Firefox) but not with Chrome natively. There are many Greasemonkey functions that Chrome does not support yet.
I copy and paste a post from GreaseMonkey:
There is no greasemonkey extension for google chrome. What actually happened is chromium (the project which google chrome is based) developed it's own extension system and one component of that extension mechanism (probably inspired heavily by greasemonkey in the first place) works in almost exactly the same way (an external javascript interacting with a page purely through it's DOM) as greasemonkey. The chromium system uses a completely different api but effectively does the same thing. This large overlap in purpose and functionality combined with the popularity of greasemonkey on firefox meant they decided to implement the greasemonkey api (the majority of it anyway) natively within chromium. From there they went one step further and had the browser automatically wrap any greasemonkey scripts inside a chromium extension automatically and effectively made greasemonkey scripts a first class citizen.

What is in your JavaScript development toolbox?

I have to do some JavaScript in the future, so it is time to update my toolbox. Right now I use Firefox with some addons:
JavaScript Shell from https://www.squarefree.com/bookmarklets/webdevel.html
Firefox Dom Inspector
Firebug
Greasemonkey
Stylish
I plan to use Venkman Javascript debugger as well as jsunit and js-lint.
For programming I'm stick with vim.
So what other tools do you use when developing JavaScript?
I use both Firefox and IE for Web Development and a few add-ons in each:
Firefox:
Firebug
Web Developer Toolbar
Internet Explorer:
IE Developer Toolbar
Fiddler
Visual Studio for JS Debugging
I sometimes use Emacs with Steve Yegge's js2-mode, evaluating code with Rhino & John Resig's env.js to load jQuery or Prototype in my standalone scripts.
This allows me to explore javascript, jQuery, and Prototype outside of a browser.
Example:
var window;
load("Library/env.js");
window.location = 'index.html'; // Load the page 'index.html'
print($('aForm').id); // Play with the Dom in a standalone script!
Web Developer Toolbar (Firefox Addon)
Nikhil's Web Development Helper (IE Toolbar)
Firefox:
Firebug - Invaluable for debugging markup and code while testing ideas directly in the browser
Rainbow for Firebug - JavaScript syntax highlighting
Pixel Perfect - Overlay images on any page, make it match the design on every pixel
Web Developer Toolbar - Just about any tool you can think of
Firecookie - Manage your cookies
YSlow - Suggests how to boost the download performance
Windows-only:
Fiddler - A great HTTP proxy with debugging capabilities
Internet Explorer:
- Web Developer Toolbar - Missing a few things but still very complete
Firebug on Firefox
IE Web Developer toolbar on IE
JS Lint
A couple more::
IE Explorer Toolbar
Firefox Developer Toolbar
Best way to debug JavaScript in Internet Explorer is to use Visual Web Developer Express.
If you like a cross browser logging solution check out Firebug Lite!

Categories