How to develop disable private browsing option as inbuilt feature in firefox extension? - firefox-addon-webextensions

I am designing to develop a firefox extension which will offer inbuilt feature to stop private browsing. I have tried given below code, but still private browsing remains same.Please can anyone help me to figure this out? Given below my manifest.json code
{
"manifest_version": 2,
"name": "Cat Gifs!",
"version": "1.0",
"incognito":"not_allowed",
"background": {
"scripts": ["background.js"],
"persistent": false
},
}

Related

How do I trigger a Ansible on an EC2 instance from our hosted react app?

We have a react app deployed in AWS which allows us to store specific device information, and we also have created an ec2 instance which takes that data and allows us to configure the device it was based on. We are trying to create a way to run the playbook within the EC2 using a button on the web app, however currently drawing a blank on how to do so.
We used to use a application named Morpheus but ran into all sorts of issues. We are now trying to keep everything from within AWS.
Any suggestions are helpful.
So I have tried to make use of the SSM Document and it has begun to confuse me. I attempted to make use of the script to try navigate to my folder and then run the playbook. However my method is not working at all.
{
"schemaVersion": "2.2",
"description": "Command Document Example JSON Template",
"parameters": {
"Message": {
"type": "String",
"description": "Example",
"default": "Hello World"
}
},
"mainSteps": [
{
"action": "aws:runPowerShellScript",
"name": "navigate to file",
"inputs": {
"runCommand": [ "cd /echo_configure/Config" ]
}
},
{
"action": "aws:runPowerShellScript",
"name": "execute file",
"inputs": {
"runCommand": [ "ansible-playbook apply.yml" ]
}
}
]
}
Could I get some help to push me in the right direction

chomre.storage returns undefined in localhost when extension created with create-react-app

I am trying to use chrome.storage API. However, when I perform a console.log of chrome.storage in my browsers console, both my localhost and built extension returns undefined.
There is an extension which I know makes use of chrome.storage API and when I do the same it returns an object with correct information (looks like storage is the only thing that is different compared with both extensions). I have implemented chrome.storage.sync.set and chrome.storage.sync.get but I experience issues relating to chrome.storage being undefined.
My manifest.json file looks like below
{
"name": "Name of application",
"version": "1.0.0",
"manifest_version": 2,
"description": "A plain text description",
"icons": {
"32": "logo_32.png",
"64": "logo_64.png",
"128": "logo_128.png",
"256": "logo_256.png"
},
"browser_action": {
"default_icon": "logo_32.png"
},
"author": "Author name",
"chrome_url_overrides": {
"newtab": "index.html"
},
"permissions": [
"storage",
"http://localhost/*"
]
}
When I console.log just chrome (console.log(chrome)) I get returned object, which is different from the build extension.
I have searched around and can not find a solution. Most answers I have found simply state checking the permissions in the manifest file.
As I created the extension with create-react-app, is there any other configuration I need to change in order to be able to use chrome.storage?
Update
So instead of reloading extension from extensions, I deleted the extension and then added the extension back. This allows me to access chrome.storage when built. However, for my localhost, I still get chrome.storage is undefined. Is there a way to fix this?

How to preserve extensions in Firefox with VSCode and request Launch

I'm attempting to debug a React app with React Dev Tools and Firefox Developer Edition. I can't install React Dev Tools to the profile Firefox is using when it is launched via VSCode. I have React Dev Tools installed when I launch Firefox myself via opening it in /Applications.
However, when I run the below launch.json profile, there are no extensions shown under Preferences -> Extensions & Themes -> Extensions in FireFox after it launches.
{
"name": "Launch localhost",
"type": "firefox",
"request": "launch",
"reAttach": true,
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
},
However, I can follow the directions here and launch Firefox with the terminal and attach my debugger to it. This Profile has React Dev Tools and it works fine running:
/Applications/Firefox\ Developer\ Edition.app/Contents/MacOS/firefox -start-debugger-server
launch.json:
{
"name": "Attach",
"type": "firefox",
"request": "attach",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
},
But how do I make the first one work with a launch request instead of attach? From reading it seems to have something to do with the profile
I had the same problem and was able to fix it by adding to my launch.json:
"profile": "my-firefox-profile"
Firefox can have miltiple profiles installed. You can check them by typing about:profiles in firefoxes adress bar.
It will show you a list of profiles. The one marked as Default profile: yes should be the one to choose.
My launch.json now looks like this:
{
"name": "Firefox",
"type": "firefox",
"request": "launch",
"reAttach": true,
"url": "http://localhost:4300",
"webRoot": "${workspaceFolder}",
"profile": "default-release-1"
},
Background:
Firefox profiles hold settings like browsing history, bookmarks - and most importantly - add-ons. By telling VSCode to use a specific profile it serves with the installed plugins.
This will also work if you have the same problem with Angular or Vue.
In addition to the accepted answer, I had to also add the following to launch.json to make Firefox launch with the specified profile.
"keepProfileChanges": true
I am using VSCode 1.52.1 and Firefox 84.0.2.

How do I properly setup VS Code to debug in chrome, using an existing logged in Chrome user profile?

I have a React application that I'm writing in VS Code. In order to test and debug my work, I go to the the terminal and enter npm start. This starts the application server and it properly launches chrome under the current logged in user, which has the React Devtools extension installed.
However, I'm also using the Debugger with Chrome extension in VS Code. In order to use those debugger tools, once the application has been started by npm, I need to hit F5 and this launches a new browser window for Chrome. Under this mode, my breakpoints are being hit in VS code, and I can inspect as I need too.
However, the difference is that when I hit F5, VS Code opens a new browser Window that looks like a newly installed instance of Chrome. Since I use Chrome in multiple VMs and architectures, I've setup my Google account so that as I login into my profile on each machine in Chrome, all necessary bookmarks and extensions are loaded into that instance of Chrome.
F5 debugging isn't showing that user profile information, even though a regular launch of Chrome is showing those details, as is the initial launch of the browser when I run npm start. Is there a way to alter my VS Code configurations so that when debugging in VC Code with the Debugger for Chrome extension, I can access my Chrome profile with all my desired extensions and tools?
Also, here's my launch.json file. I think this is used by the debugger.
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}",
}
]
}
I think these are defaults and I think, maybe, this is what NPM is using rather than whatever is launching the debugger & browser with F5.
Add "userDataDir": false to your launch config, like this:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}",
"userDataDir": false
}
]
}
BUT you must first quit all running instances of Chrome, because it's not possible to put a running Chrome user profile into debug mode. This is why the extension creates a new user profile by default.

How to deploy Gmail Contextual Gadget on Google Marketplace as App for Gmail?

I have a simple plugin that renders gmail data. I want to deploy on Google Marketplace.
I followed this link : https://developers.google.com/gmail/contextual_gadgets
I have uploaded the zip with manifest.json file on chrome developer console. The plugin is available in the marketplace. But when I install and run the plugin it opens the website rather than enabling the plugin on Gmail.
I have entered details into Google Apps Marketplace SDK, defined the email extractors.
I have created the manifest.json file as follows and uploaded to developer console. Below code is just an example, I have mentioned valid values in the JSON.
{
"manifest_version": 2,
"name": "My App",
"short_name": "My App",
"version": "1.0.0",
"description": "Desctription................",
"app" : {
"launch" : {
"web_url" : "https://www.myapp.com"
}
},
"icons": {
"128": "icons/128x128-icon.png",
"16": "icons/16x16-icon.png"
},
"container": ["DOMAIN_INSTALLABLE"],
"api_console_project_id": "XXXXXXXXXX"
}
The application was published on marketplace. But the plugin is not enabled in my gmail app. Rather it opens the website link.
Please guide what is missing in the configuration or in the manifest file.
Thanks in advance!

Resources