Can I change a config value in firefox with an addon? - firefox-addon

How is it possible to program an Addon that changes a certain config value in Firefox, that usually is only accessible via about:config?
Is there a template I could use? Or Do I have to start from scratch?

Please see the Preferences documentation and API reference, in particular Adding preferences to an extension and Code Snippets.
Just to be clear: The nsIPreference* APIs can be used to query/modify any preference, not just add-on specific ones.
SDK users should use simple-prefs (for add-on prefs), and/or preferences/service.

Related

Is there a way to export the enabled Conversion Variables, Traffic Variables and Success events to excel in Adobe Analytics?

I wanted to export the list of variables defined in Adobe Analytics, to create a document. But then other than copy paste i don't see any other way to do the same. I have to do the same for more than 70 Report suits. I feel its too much manual work.
I have tried copy paste. Which i don't want to do, as its too much manual work.
Is there a way which i am missing in Adobe Analytics which does this easily in one click or something? As in Google Analytics Google Tag Manager we have an option to export the container which i don't see in Adobe Analytics.
Thank you #CrayonViolent. But i found one more way to get the list of variables defined.
The admin Report Suite Manager lets you to do the same.
Analytics > Admin > Report Suites
Select Report Suite
Click on Download:
This will Generates an Excel spreadsheet of all settings for the currently selected report suites.
I hope this helps.
Both the API and export options are great.
Another option is to use ObservePoint's free Google Sheets add-on to pull all props, eVars, listVars, processing rules, etc. into a spreadsheet. I believe it's limited to one report suite at a time, but I use it regularly to generate sharable and editable SDRs. (The add-on supports making updates in the spreadsheet and pushing them back up to Adobe Analytics.)
https://chrome.google.com/webstore/detail/observepoint-labs/ohpgoaikjjdkfjalakolccdibikodoeo?hl=en

Can I Use Google Tag Manager in Electron?

I am trying to integrate Google Tag Manager into an Electron app,
but it doesn't seem to be working. it seems like gtm codes I planted in the app are NOT sending the analytics data anywhere.
I found this issue on Electron github repo. Seems like some people are having the same issue.
I wonder if it's impossible at all to integrate GTM on Electron, or is there any way around to do this?
[Update]
While reading Alexander Leithner's answer, a further question popped up.
on Google Tag Manager - Dev Guide - Security, it says:
While most of the tag templates in Google Tag Manager are also
protocol relative, it's important to make sure that, when setting up
custom tags to fire on secure pages, those tags are also either
protocol relative or secure.
Does file:// protocol matters because GTM is protocol relative? Wouldn't it be possible to bypass this with GA's forceSSL=true option which can be set on GTM Interface?
[Final Update]
I found the perfect answer in this blog post:
Run Google Tag Manager And Google Analytics In Local Files.
Thank you Eike Pierstorff, for giving me the hint of setting storage to none, it led me to this post.
GTM by default used to use the same protocol as the webpage - that's what "protocol relative" means. I.e. there is a bit of code that loads the GTM library, and if this uses the file protocol (as per the embedded wegpage) it will try to load the library as a file, which does not work. However GTM has switched from protocol relative to https by default, so I don't think GTM is your problem here.
You mention Analytics data, and if this refers to Google Analytics then your problem is not with GTM, it is that GA does not work on local files. Google Analytics uses a cookie to store the clientId (which is needed to aggregate individual hits into sessions/users), and since you cannot set cookies on a local file this does not work.
A possible workaround would be to go to your GA tag in GTM, to the "set fields" settings, set "storage" to "none" (which means that no cookie is set) and pass in a clientId manually.
As this comment by Samuel Attard (MarshallOfSound), who is an Electron developer, states that Google Tag Manager does not work when the including webpage is loaded using a file:// URL.
If you'd instead load your application via http:// (or more preferably via https://), you would be able to use Google Tag Manager.

Find features of a non Microsoft program

I'm not sure how to even ask this question, but let's say I have a program such as Google Chrome. How would I find out the "features" of it so I can use PowerShell to modify it.
For example, how would I have Chrome open a web page and click a button.
I know for IE, you can use $ie.document.getElementById("loginform").submit() to click a button.
Thank you,
Tony
You can't ever really get the same amount of control over non-Windows programs using Powershell.
In terms of Chrome, you could simply open the browser and go to a webpage with:
$Start-Process "chrome.exe" "www.google.com"
There is generally not that much more for further functionality, but with Chrome you may be able to do things like change settings and configuration. Check out the (large) JSON file Preferences and other config files, which you can find in Chrome's local appdata folder (Win+R, %localappdata%, Google/Chrome/User Data/Default). I'm not too sure but it may also be a bad idea to mess around with these files.
I also did a Google search and found this third party powershell tool for browsers, called Selenium. Here's the list of extensions.

Awesome desktop manager widgets

I came upon this problem before, but only now it really renders awesome desktop manager useless.
I was searching how to connect to Wifi with awesome. Found Gigamo Wifi Widget. Cool, how do I eat it?
The awesome wiki entry on widgets does not really answer this question.
I know my question is very stupid and the answer is somewhere in the documentation but I have no idea how to read it. How and where do I add widgets I find on the Net to my awesome lua files?
EDIT:
when searching where is the rc.lua file henfiber mentioned, I came upon Archlinux wiki on Awesome, which put most important things in one page.
You can always use NetworkManager which is available for installation in most official repos. It contains an applet which creates an icon at your system tray. You can launch the applet at start-up, placing this line in your rc.lua file:
awful.util.spawn("nm-applet")
or you can start it manually from your terminal, writing:
$ nm-applet &
Then you can left-click at the NetworkManager Applet icon at the system tray and select from the list of available wifi access points. Additionally, the Network manager applet allows you to perform more advanced functions, like connecting to VPN.
Also, it is quite easy to use 3rd-party widgets you find in the wiki or in github. It requires these steps:
Download the widget .lua file - let's say it is called
cool_widget.lua
move it in ~/.config/awesome/ so it is :
~/.config/awesome/cool_widget.lua
An alternative is to use the structure
~/.config/awesome/cool_widget/init.lua
it is better when your widget requires more than one files.
Load the widget at the top of your rc.lua file:
cool_widget = require("cool_widget")
Add the widget in a wibox (toolbar) in the same way you add built-in
ones

Firefox extension: Embed javascript in a webpage

I want to insert some script into every page, which have some functions that will be called by the modified HTML of that page, using a Firefox extension. I am able to insert the JavaScript into the head of the HTML, and also modify the page, but the java script functions are not called by the onmouseover event.
Does someone has any pointer on how to do that, using java script in local extension or as a online resource.
No GreaseMonkey, I need to do it with my plugin and not ask user to install greasemonkey, my plugin and the scripts.
Greasemonkey does this. It's excellent!
Make a Greasemonkey script. See Userscripts.org for lots of example ones to work off.
Why not use Greasemonkey? It allows you to execute javascript on any page on Firefox, and if executing the code you enter isn't good enough you could dynamically add links to the head, too.
you can modify the DOM using Firebug. I am not sure if you can load files locally.. sounds malicious. Also, you can just run arbitrary javascript commands in the Firebug console (a la python/ruby console)
There are some Greasemonkey-to-extension "compilers" (or extension-wrappers) out there:
Arantius's GM compiler
Gina Trapani's multiple-GM-script compiler
I've used the first one with extensive internal tweaking over time. However, I don't believe the compiler is actively maintained (default max-version is only 3.0), so may not be up-to-date with the latest GreaseMonkey, or FireFox.
I think Gina Trapani's is more designed for multiple scripts targetting the same domain, but I haven't used it.
Neither of these is a "GreaseMonkey solution" per se, as the end-user never has to install GreaseMonkey. They get a real-live FireFox extension. The core is very similar to GM, but you can change or add as much as you like.

Resources