Do I need a Firefox plugin or an extension? - firefox

I need to read every url that loads into the navigation bar of firefox (either by type in or by clicking a link), pass them through a filter and decide if allow the url to open or not.
I have some experience on firefox extensions but not with plugins.
Do I need to do it using extensions or plugins for this?
I currently have a BHO for IE that does this, and I get the URLs using the web browser events.

An extension would be just fine. For what you want to do, you need nsIObserverService, and http-on-modify-request observer.

You can use Adblock Plus (See the video)

Related

Scraping an Angular website with selenium and C# returns the angular script, not the rendered web page

This seems to be by design as far as I can tell. Selenium can see the initially loaded HTML, but not the HTML after it's been massaged. I've tried IE, Chrome and PhantomJS and they all show the same behavior. So does the built-in Chrome debugger, until you inspect an element on the page, you can't query any of the rendered HTML.
I'm looking for any suggestions about how to scrape the web page. The only option I see right now is finding the chrome process, triggering the inspector, clicking inside, then running the Javascript. Needless to say, this sounds fragile.
I also haven't been able to find anything on capturing the Ajax calls from selenium so I can make them and capture the JSON. When tried copy / paste from the chrome network tab into selenium I got a missing application block message.
Does anyone have any other advice?
Since I can replicate the issue in the chrome debugger, I don't see posting code as useful. It looks like a design decision.
Ralph
Sadly, I wasn't able to do things in a straightforward way. Instead, I used Selenium to do the login and navigate to the page, then use windows API calls to click inside the window send ^a^c to copy the data and an absolute location to click on the button to go to the next page.
The site is set up so that ^a^c copies the raw data for this site. I don't know if that's standard for Angular or not.
Fragile, but it works.

firefox: take screenshot programmatically

It's possible to take screenshots of web pages in Firefox using the developer toolbar. Is it possible to do this programmatically too, e.g., from the command line? I've tried with Selenium, but with no luck.
edit: I know it's possible to take screenshots using Selenium, but this only gets you the full screen. Using the developer toolbar in Firefox, one can use CSS selectors to select only parts of a page, which is what I want to do (and forgot to specify, sorry). What I've read online is that Selenium cannot access the developer toolbar because it's not part of the DOM.

Create a new tab instead of a panel

I have gone through the examples of Add-on SDK 1.5 yet haven't seen anything like a web page which the addon can interact with the user and get input from him. There are only dialogs called panels and I really would like to have a real page in a tab like in google-chrome addons.
Is it even possible with the Add-on SDK (1.5)?
Of course you can create a tab, you use tabs.open(). As to interacting with this tab - you probably want to register a content script before opening the tab. Just like you would do it with Google Chrome.

How to make a extension widget on the top right side of firefox?

I port a Chrome extension to Firefox. Because the XUL-based API is quite different from Chrome API, so I use the new add-on SDK of firefox.
There is a interface called "widget" can be used to make a little icon button like "BrowserAction" of Chrome, but "widget" is on the bottom of window, "BrowserAction" is on the top right side of window.
Some firefox extensions, for example, GreaseMonkey , have widgets on the top right, so I'm asking how to implement it using add-on SDK, not XUL based API?
Erik Vold has created a library that allows you to do this:
https://github.com/erikvold/toolbarbutton-jplib/blob/master/lib/toolbarbutton.js
While this code isn't included in the SDK libraries, it can be used to get the result you want with the current version of the SDK. You can see a quick example using Erik's library here:
https://builder.addons.mozilla.org/addon/1031142/latest/

Run context.drawWindow method through a bookmarklet

I want to capture a webpage as an image. I am able to do this using a firefox extension using context.drawWindow method. Now I want to strech myself and see if I can do this using a bookmarklet :)
I remember reading somewhere that context.drawWindow() works only from the firefox toolbars. I dont know if that's still true or not.
Can anyone shed some light if I can execute context.drawWindow() from a bookmarklet or no?
Thanks
Kapil
You can't, since bookmarklets run with the permissions of the page, and drawWindow is chrome-only (can only be used by Firefox UI and extensions, not Web pages).

Resources