Can Firefox 57+ WebExtensions manipulate userChrome.css? - firefox

is it possible for a Firefox WebExtension to read/write to a user's userChrome.css file? I was in the process of writing an extension that allows users to customize certain browser icons. I realize this isn't possible without my extension having access to the userChrome.css file. Could reading/writing files be possible through native messaging perhaps?

Related

Transfer/synchronize WebExtension data between Firefox Desktop and Firefox Android

I'm making a WebExtension (for Firefox) that tracks lists for the user. The user can add/remove elements from a list, or switch an element from one list to another, which means the extension needs the most recent version of the lists to work with.
So to be used on both desktop and Android, the extension needs to transfer/synchronize some data (which can be stringified).
I'm trying to find a way for the user to do it as simply as possible, without using external services.
The ideal solution for that (completely transparent for the user) would be to use storage.sync, but although it does synchronize between devices, it doesn't (yet) sync between normal Firefox (desktop) and Firefox for Android (implementation tracked at https://bugzilla.mozilla.org/show_bug.cgi?id=1316442).
Another solution would be to use the bookmarks API, but it's not supported by Firefox for Android (https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/bookmarks) either.
That leaves me with two solutions that I can see:
Letting the user save/retrieve the data to/from a local file, which means they need to copy the file to the other device (that's what I have in place right now).
Saving/retrieving the data to/from a third-party server (which means I would have to create a server, and have the user make an account on it).
Is there any other solution that I'm missing?
According to this support document, the following data is synced from/to Android: bookmarks, history, open tabs, form information and passwords.
This chart shows which web extension APIs are supported on Android:
Bookmarks: no API yet on Android
History: no API yet on Android
Tabs: API supported. Extensions that should occasionally or one-time sync could implement a manual process (this is a useless flow for OP as the question describes a flow where syncing should occur often):
Open a tab with a web-extension or data URL with sync data in the query parameters. In this tab, display some text asking the user to open Firefox on the other device. Keep a record that you opened this tab locally using sessionStorage.
When the tab is opened on the other device and the sessionStorage is missing, get the sync data from the query parameters and display a message that the data was synced and that both tabs can now be closed.
Form information: no API yet
Passwords: no API yet
Not mentioned in this list, but also synced is BrowserSettings. It allows overwriting some fields that are synced (homepageOverride, newTabPageOverride), but those fields have to be defined in manifest.json so they cannot be dynamic. Also, it would probably interfere with normal functioning.
In conclusion: wait for browser support or pick a server solution.

Displaying PDF and website in Windows

In Windows, is there a native way to display PDF files and simple websites?
On Mac, both tasks are very simple:
[[PDFView ...] setDocument:[PDFDocument ...]];
[[[WebView ...] mainFrame] loadRequest:[NSURLRequest ...]];
Is there anything comparable on Windows? From which version?
There is nothing native in Windows for embedding a PDF document in an application. You would have to host a third-party ActiveX/COM container, such as from Adobe Acrobat, to handle that.
For a webpage, you can host Internet Explorer's WebBrowser control in your app. Some third-party browsers, like Mozilla and FireFox, also support hosting in apps.
Or, you could use the ShellExecute() function to open a given document/url in its default external application instead of hosting it inside of your own app.

Locking user to browser window (using .dll files)

Is it possible to lock a user in chrome using .dll files (NPAPI plugin) or any other method?
I want to invoke chrome browser in highly controlled environment preferably on Windows. I would download chrome for businesses and write policies such that user isn't allowed to access any url except one.
I would create a packaged app and create an application shortcut on desktop for user which goes to the url. So it will open in KIOSK mode. But I would want that user shouldn't be able to navigate away from chrome, specifically that window and shouldn't be able to use any other program until he logs out of the application or explicitly closes the window. That means disabling function /ctrl/alt and window keys.
Something like this but with chrome.
Even opening chrome itself in 'locked' mode is not a problem.
Has someone ever implemented it? Is it possible using NPAPI plugin or any other method? If anybody could direct me towards any such resources I would be grateful.
No, this is not realistically possible using an NPAPI plugin, at least not by itself. At minimum you'd need an extension (see http://npapi.com/extensions).
If you loaded it from an extension it might be possible to get the window handle of the browser and such, but I think you'd probably be better off with a separate app.

Interact with Google Chrome bookmarks from a Cocoa App

I am trying to write a Cocoa App that needs to manipulate Chrome Bookmarks. What is the best way to get access to Chrome bookmarks to allow insertion, deletion, updating.
Chrome stores its bookmarks in a simple text file called Bookmarks which (on OS X) is stored in the user home directory, $HOME/Library/Application Support/Google/Chrome/Default/Bookmarks. It's a JSON file for which I guess there are several libraries API available. (like this one)
If you mean to directly manipulate the bookmarks stored in Google cloud, check this link.

Is it possible to use local resources from a web-delivered XUL app?

Is there a way to execute a XUL program delivered via "trusted" web site outside of the browser sandbox?
My XUL program executes beautifully in local XULRunner and in firefox with the -add parameter.
Now, I'd like to put it on my secure intranet and allow users to click a button which will launch it. My app has behaviors that access local resources such as .exes, so it seems like the browser sandbox will prohibit the app from carrying out those behaviors. But I'd really like to create a browser-based launchpad for this app. And since I'm hosting it on my intranet, which is trusted in my users' browsers, it seems like it should be possible.
Mozilla's documentation says "It is also possible to open XUL files directly from the file system or from a remote web site; however they will be restricted in the kinds of operations they can do, and some aspects of XUL will not work." But given that "Remote XUL is DEAD", I need a way to kickoff my local XUL app without executing XUL in the browser.
If not, is there a firefox extension that could run this XUL app?
To elaborate on my initial comment, turn your app into an extension (although most of the steps should be familiar to you already) and then secure your updates.

Resources