Firefox extensions equivalent with chrome's - firefox-addon

I have one question:
There is the "matches" pattern in a manifest.json file which says under which domain the extension should function.
Is there the same for the firefox extension? Or must be determined in a js file?
If the second option is the correct one, could someone tell me how? Up to now, I get the url of the tab about 10 times (using alerts).
If you know any website which provide examples for 100% amateurs for ff extensions, I would appreciate it, its 2 days I crawl the internet without stopping but I cant find a complete solution!
Thank you for reading.

Firefox addons don't necessarily run on a per-website basis -- they can exist independently of this (like a weather widget, for example). If you want to modify a page, based on its URL, you can use the page-mod module in the Addon SDK. Here's a tutorial to do just that.

Related

Replace Thumbnails and Theme Switching

I am currently making an extension, and I hope I could get some
practical advice on feasibility :
I want my extension to go fetch/load a local folder of custom homescreen
thumbnails(top-sites), and then replace the auto-generated thumbnails in
the homescreen with those it loaded.
The extension would be able to read the associated domain names of the
thumbnails and then replace them accordingly.
(e.g :Pinned Url : youtube.com/anything : Ok so it’s YouTube : then replace the thumbnail with “Custom_Youtube_Thumbnail.png”)
Does that seems possible to you ? (Before I dive in head first)
I saw that the top-sites API is not quite available
https://bugzilla.mozilla.org/show_bug.cgi?id=1246693 but maybe I’m wrong.
Extra : My extension is switching themes (like this :
https://github.com/mdn/webextensions-examples/tree/master/theme-switcher ).
Would it be possible to switch the thumbnails accordingly
(Custom_Youtube_Thumbnail_light.png > Custom_Youtube_Thumbnail_dark.png)
as i’ve made a version for each.
Would be a pleasure to hear your opinion on this, or just pointing
useful resources to me,
I’m not asking for a perfectly baked solution.
Hope I’ve been concise.
Thanks for reading me !
Very nice idea you had.
But In short: no possible.
Main problem is that you cannot inject and manipulate on the homepage which is a built in browser tab.
"You cannot inject code into any of the browser's built-in pages, such as: about:debugging, about:addons, or the page that opens when you open a new empty tab."
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/executeScript

Rich link preview in flutter

Is it possible to make a preview from an url, grabbing all the information such as title, relevant texts and images. Is there any plugins I can use readily?
See this Native android plugin
You can do this way :
1)Create a user at https://www.linkpreview.net
2)Generate an Access Key.
3)From your code call
http://api.linkpreview.net/?key=<Your_API_KEY_From_Step_2>&q=https://www.google.com
It returns the meta tags in JSON as below :
{"title":"Google","description":"Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.","image":"http:\/\/www.google.com\/images\/branding\/googlelogo\/1x\/googlelogo_white_background_color_272x92dp.png","url":"https:\/\/www.google.com\/"}
4) Use it in flutter widget to create a preview.
Hope I'm not late to answer this question, There is a plugin for link with previews Rich link preview
Currently, there is not an open source library for flutter providing these meta tags for a website.
There is a temporal solution, using these freemium APIs for getting this information. The main drawback is that the requests are limited before paying.
I know I'm a bit late but I found a solution for that.
The comment of Sudip might work but if you have a lot of preview to generate, you will have to subscribe and pay..
I couldn't use the library rich_link_preview because of some depency issues (it requires http < 1.12.0).
So I had to do it myself. Writting the complete answer in this comment would be too long so I'll tell you how I did it.
I followed this youtube tutorial. If you are too lazy to watch the entire video you can look at his Github Repo. It worked for me and it is not too long (there are only 2 relevant files):
lib/link_preview.dart
lib/helper/fetch_preview.dart

Delphi: Set Browsers Homepage

I want my application to be able to set IE, Firefox, Chrome & Operas homepages when a button is pressed. I understand IEs homepage is set in the registry, which I understand how to change, but can anyone give me any help with the others? Thanks
Chrome stores the homepage in a file called 'Preferences'. On Windows XP, this is located at;
C:\Documents and Settings\USERNAME\Local Settings\Application
Data\Google\Chrome\User Data\Default
On Vista+, it's located at;
C:\Users\USERNAME\AppData\Local\Google\Chrome\User Data\Default
This file is JSON format, and so it can be opened and viewed as plain text. In order to change the homepage, you'd need to load the JSON from this file, and change the homepage field value. You may also need to change the homepage_changed field value in order for it to stick. Using something like SuperObject to change the field would be an easy solution (if I get time, I'll write up some example code later).
Firefox uses a pref.js file to store it's settings, and realistically, a way of changing this would be to load this file, find the something that's along the lines of;
user_pref("browser.startup.homepage", "[URL]");
...and edit it as appropriate before saving the file. This should be a simple task using some simple find-and-replace code. I'd strongly advise that you use a pos() function though, as it could be that the end-user has already got their own custom homepage set and so searching for a preset string (e.g. [URL]) may not work, and certainly wouldn't be reliable.
A quick search hasn't given me enough information about Opera to provide a solution, but I'll keep looking and respond if I do find such a way.
Note that none of these methods have been tested and are merely provided based upon some very quick research.

To launch/activate/run Chrome extension with a clickable webpage link?

I have always been using Safari but I pulled the plug on Safari completely a while ago, and the ability to do a lot of things with Chrome, makes me want to be able to do more.
Here is what I was wondering:
I have a lot of newly installed extensions and webapps.
I know there are extensions that can be used upon activation and other extensions that run in the background without the need for it to be activated by clicking a button of the extensions icon.
Is there a way to launch (activate) an extension in chrome with a link (URL) in a webpage. I mean is there a URL path to activating an extension.
Also,
I like the pinned tab feature, but it seems I can only do this: Pin a tab and for it to open just like that every time by adding current tabs to 'open these pages'. But if I pinned for eg. gmail.com and then I close it and later open it up again little later it won't pin it. Is using JSON with the 128 px icon and making your own web app the only way this can be achieved?
Thank you.
As far as I know: No.
What I got from reading through the Chrome-docs is, that websites can connect to activated extensions by using the Chrome API's method runtime.connect.
I know there are extensions [...] activated by clicking a button of the extensions icon
This doesn't seem to be a general feature of Chrome extensions. The Chrome-intern activation can be found at chrome://extensions/ in your browser. These settings can't be modified by websites. You may want to create a work-around by using a "second" activation-layer in your extension.
Websites can only ask the browser to install extensions by using the webstore API.
To your second question: This chrome-extension should allow you to automatically pin tabs specified by your url (haven't tried it for myself though). Maybe this can solve your problem.
I see this answer comes late but if anyone stumbles on this as I did, hopefully might find this useful. I can help you with the url of a Chrome Extension. Open the Web Inspector console and type this to get the url:
chrome.extension.getURL()

How Can I Automatically Execute A Link In Internet Explorer

I am trying to create an application to print documents over the web. I have created my document, and made a web page with a meta refresh tag, along the lines of this:
<meta http-equiv="refresh" content="3;http://example.com/download.epl2" />
I specify that the document has a content-type of application/x-epl2, and I have associated .epl2 files on my computer with a program that silently sends them to the printer.
I have put the website into my trusted sites zone.
Currently Internet Explorer pops up the "Open, Save, Cancel" dialog box with no option to automatically open the file.
Is there a setting in IE6/7/8 that I can use to have IE just open the file without prompting?
EDIT
The actual content of the file will differ based on the job, but essentially it is text that follows the Eltron Programming Language.
EDIT
I have accomplished this in both Chrome and Firefox by choosing "Automatically Open Files Of This Type From Now On"
EDIT
The machines this program will be used on will effectively be kiosks that are limited to only accessing my website from their web browsers, so I'm not worried about rogue websites sending documents to my printers.
EDIT
I am using PHP to generate the documents and HTML on the server side, though I expect the solution to be language agnostic.
I would expect that not to be possible, because then you could stumble onto a site that automatically loads and prints a 5000 page document or something, which would not be good.
If you always had a secret desire to develop a custom URL protocol (I know I do), this might be a good excuse to do it. ;-)
http://msdn.microsoft.com/en-us/library/aa767914%28VS.85%29.aspx
There are 1-2 prompts when opening such a link for the first time in IE, but you can choose to automatically open them after that.
I would use javascript to make this happen.
Javascript Window Open
EDIT
Since you have control of the windows box you could use an automate script process to interact with the print window.
autoit3: ControlClick
Write a small utility program that does nothing but send the file passed to it on the command-line to the default system printer.
Then, edit the registry under HKEY_CLASSES_ROOT to associate this program with the .epl2 filetype.
I don't have time to investigate it for You, but there were lots of exploits that could be helpful. Using ie6 without certain fixes seems helpful.
Also there should be an option called "Automatic prompting for file downloads". I use Linux nowadays so I can't chceck if it helps. I found it in some docs.
I'm on a Mac at the moment, but if this is possible in IE I would imagine this page holds the answer to it (or at least hints at it) http://support.microsoft.com/kb/883255
I believe what you're looking for is a setting in Windows, not IE:
Microsoft Support: Not Prompted to Specify Download Folder for File
Try using an older version of IE. Security was looser in the older versions and since it's a non-issue, this could be the quickest solution.

Resources