I think there's a file where settings of every addon installed are stored. Where can I find it?
I need the name of the extensions, the version, the state(enabled,disabled,uninstalled) and the extensions ID.
All the information you seek is in $profD/extensions.json
E. g.
{
"schemaVersion": 17,
"addons": [
{
"id": "addon#example.org",
"syncGUID": "-3yoR7F-ml47",
"location": "app-profile",
"version": "0.0.1.34",
"type": "extension",
"internalName": null,
"updateURL": null,
"updateKey": null,
"optionsURL": null,
"optionsType": null,
"aboutURL": null,
"icons": {
},
"iconURL": null,
"icon64URL": null,
"defaultLocale": {
"name": "My addon",
"description": "Addon description",
"creator": "me",
"homepageURL": null,
"developers": [
"me"
]
},
"visible": true,
"active": false,
"userDisabled": true,
"appDisabled": false,
"descriptor": "/home/user/.mozilla/firefox/w7svh0gr.ffnightly/extensions/addon#example.org",
"installDate": 1452014720000,
"updateDate": 1452015546000,
"applyBackgroundUpdates": 1,
"bootstrap": true,
"skinnable": false,
"size": 147533,
"sourceURI": "file:///home/user/addon.xpi",
"releaseNotesURI": null,
"softDisabled": false,
"foreignInstall": false,
"hasBinaryComponents": false,
"strictCompatibility": false,
"locales": [
],
"targetApplications": [
{
"id": "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}",
"minVersion": "24.0a1",
"maxVersion": "37.0a1"
},
{
"id": "{aa3c5121-dab2-40e2-81ca-7ea25febc110}",
"minVersion": "25.0a1",
"maxVersion": "37.0a1"
}
],
"targetPlatforms": [
],
"multiprocessCompatible": false,
"signedState": 0
},
...
}
Don't need to find out the add-on files. Just use the AddonManager.jsm service:
const { Cu } = require("chrome");
let AddonManager = Cu.import("resource://gre/modules/AddonManager.jsm").AddonManager;
AddonManager.getAddonsByTypes(["extension"], function(addons) {
var addonData = [];
for (let i in addons) {
let cur = addons[i];
addonData.push({
id: cur.id.toString(),
name: cur.name,
version: cur.version,
active: cur.isActive
});
};
console.log(JSON.stringify(addonData, null, ' '));
});
For more detail on this just read these two docs.
Related
I am calling API and getting below output but from the output and i want to find the key based on value input and my input value is "vpc-tz" how to achieve this in ansible using json_query?
{
"json": {
"allScopes": [
{
"
"clusters": {
"clusters": [
{
"cluster": {
"clientHandle": "",
"type": {
"name": "ClusterComputeResource"
},
"universalRevision": 0,
"vsmUuid": "423B1819-9495-4F10-A96A-6D8284E51B29"
}
}
]
},
"controlPlaneMode": "UNICAST_MODE",
"description": "",
"extendedAttributes": [
],
"id": "vdnscope-6",
"isTemporal": false,
"isUniversal": false,
"name": "vpc-tz",
"nodeId": "85e0073d-0e5a-4f04-889b-42df771aebf8",
"objectId": "vdnscope-6",
"objectTypeName": "VdnScope",
"revision": 0,
"type": {
"name": "VdnScope"
},
"universalRevision": 0,
"virtualWireCount": 0,
"vsmUuid": "423B1819-9495-4F10-A96A-6D8284E51B29"
},
]
}
}
Here is a query which works:
json.allScopes[?name=='vpc-tz'].name
I'm quite new to Laravel Nova, and I'm trying to implement dependent fields but there's no easy solution to it. I want to display a checkbox if a certain value is selected in a select dropdown.
After a little searching, I found this: https://github.com/epartment/nova-dependency-container. I'm trying to use this, but something's not working right. I'm using Laravel v5.7 and Nova v1.3.2. Hence, I've installed v1.1.2 of this package.
I followed the installation guidelines and have written the following code:
<?php
namespace App\Nova;
...
use Epartment\NovaDependencyContainer\HasDependencies;
use Epartment\NovaDependencyContainer\NovaDependencyContainer;
...
class Submission extends Resource
{
use HasDependencies;
....
public function fields(Request $request)
{
$fields[] = Select::make('Route', 'route')->options([
0 => 'First Name',
1 => 'First Name / Last Name',
2 => 'Full Name'
])->displayUsingLabels();
$fields[] = NovaDependencyContainer::make([
Text::make('Title', 'title')
])->dependsOn('route', 2);
...
return $fields;
}
....
}
?>
I can see the field Route with the right options and values. However, when I select 'Full Name', the dependent field Title is not displayed.
When I see the JSON response of the fields, this is what I get:
...
{
"component": "select-field",
"prefixComponent": true,
"indexName": "Route",
"name": "Route",
"attribute": "route",
"value": null,
"panel": null,
"sortable": false,
"textAlign": "left",
"options": [
{
"label": "First Name",
"value": 0
},
{
"label": "First Name / Last Name",
"value": 1
},
{
"label": "Full Name",
"value": 2
}
]
},
{
"component": "nova-dependency-container",
"prefixComponent": true,
"indexName": "",
"name": "",
"attribute": "",
"value": [],
"panel": null,
"sortable": false,
"textAlign": "left",
"fields": [
{
"component": "text-field",
"prefixComponent": true,
"indexName": "Title",
"name": "Title",
"attribute": "title",
"value": null,
"panel": null,
"sortable": false,
"textAlign": "left"
}
],
"dependencies": [
{
"field": "route",
"value": 2
}
]
},
...
I'm not sure where I'm going wrong. Would be great if someone could guide me here. Or if there's another solution that works.
Thanks!
I'm develop an chrome extension for jira which get a data from a DIV element of another website and use the data to raise a jira ticket by my chrome extension automatically.
the issue is when I call below jira api in my code I faced below error
content.js:107 POST http://myjira.com:9090/rest/api/2/issue/ 403 (Forbidden)
but as I checked my request in Post Man app everything is fine and new ticket raise in Jira.
I'm really appreciated if someone can help me to fix the issue.
moreover, I used my personal computer and the jira is on another server.
totally I want to have a extension to integrate a ticketing system with jira, without access to that site.
please have following code.
content.js
$(document).ready(function () {
var key = '';
var summary = 'undefined';
var description = '';
var comment = '';
window.setInterval(function () {
/// call your function here
console.log($('Div1').html());
console.log($('Div2').html());
console.log($('#Div3').html());
console.log($('Div4').html());
key = $('.a span:first').html();
summary = $('#b').html();
description = $('#r'')').html();
comment = $('#u').html();
if (summary == 'undefined') {
return;
}
var data = JSON.stringify({
"fields": {
"project": {
"key": "RTF"
},
"summary": "" + summary + "",
"description": "" + description + "",
"issuetype": {
"self": "http://myjira.com/rest/api/2/issuetype/10111",
"id": "10111",
"description": "Service Request",
"iconUrl": "http:/myjira.com/secure/viewavatar?size=xsmall&avatarId=10720&avatarType=issuetype",
"name": "MS Task (SR)",
"subtask": false,
"avatarId": 10720
},
"customfield_10106": {
"self": "http://myjira.com/rest/api/2/customFieldOption/10476",
"value": "EMAIL",
"id": "10476"
},
"customfield_10129": [
{
"self": "http://myjira.com/rest/api/2/customFieldOption/10450",
"value": "TEST",
"id": "10450"
}
],
"customfield_10188": [
{
"self": "http://myjira.com/rest/api/2/customFieldOption/10469",
"value": "Billing",
"id": "10469"
}
],
"customfield_10180": {
"self": "http://myjira.com/rest/api/2/customFieldOption/11000",
"value": "Support",
"id": "11000"
},
"assignee": {
"self": "http://myjira.com/rest/api/2/user?username=e.pirjahandideh",
"name": "e.jj",
"key": "e.jj",
"emailAddress": "e.jj#jj.com",
"avatarUrls": {
"48x48": "http://www.gravatar.com/avatar/68e54d1c135e85b994eb12cb9a3b7b9b?d=mm&s=48",
"24x24": "http://www.gravatar.com/avatar/68e54d1c135e85b994eb12cb9a3b7b9b?d=mm&s=24",
"16x16": "http://www.gravatar.com/avatar/68e54d1c135e85b994eb12cb9a3b7b9b?d=mm&s=16",
"32x32": "http://www.gravatar.com/avatar/68e54d1c135e85b994eb12cb9a3b7b9b?d=mm&s=32"
},
"displayName": "Emil jj",
"active": true,
"timeZone": "Asia/Tehran"
},
"components": [
{
"self": "http://myjira.com/rest/api/2/component/10071",
"id": "10071",
"name": "RR",
"description": "Managed RR"
}
],
"customfield_10189": {
"self": "http://myjira.com/rest/api/2/customFieldOption/10489",
"value": "RR/IT",
"id": "10489"
}
}
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "myjira.com/rest/api/2/issue/");
xhr.setRequestHeader("authorization", "Basic dasfasegsdfgsdfgsdfg");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("cache-control", "no-cache");
xhr.setRequestHeader("postman-token", "c6475a5e-6741-6894-5b8e-2350c7c5a176");
xhr.send(data);
}, 10000);
});
manifest.json
{
"manifest_version": 2,
"name": "Name",
"description": "Description",
"browser_action": {
"default_popup": "popup.html"
},
"background": {
"page": "background.html"
},
"version": "1.0",
"permissions": [
"http://myjira.com/",
"http://ticketing2.com"
],
"content_scripts": [
{
"matches": [ "http://*/*", "https://*/*"],
"js": [
"jquery.js",
"jquery-ui.min.js",
"content.js"
],
"run_at": "document_end",
"all_frames": true
}
]
}
I use create event api to create an event object with "onlineMeetingUrl: https://meet.lync.com/example/joyce/NLSD7Y62" but the response of "onlineMeetingUrl" is null.
Is it a bug or is there any way to create a new event with 'onlineMeetingUrl'?
Here are my test steps.
Step 1. POST /me/events
{
"#odata.etag": "W/\"BfXylo4WykyAenTZICXL5AAApUQ11g==\"",
"id": "AAMkADVmMzE2MjY0LTZkOGYtNGI4MS1iNWMxLTljYzg3MWY5MWQxMQBGAAAAAABZMfR36TVMQ6yunaqZPvVRBwAF9fKWjhbKTIB6dNkgJcvkAAAAAAENAAAF9fKWjhbKTIB6dNkgJcvkAAClFy2jAAA=",
"createdDateTime": "2018-03-07T02:31:20.6459109Z",
"lastModifiedDateTime": "2018-03-07T02:31:24.2554747Z",
"changeKey": "BfXylo4WykyAenTZICXL5AAApUQ11g==",
"categories": [],
"originalStartTimeZone": "Taipei Standard Time",
"originalEndTimeZone": "Taipei Standard Time",
"iCalUId": "040000008200E00074C5B7101A82E00800000000E5DACD60BCB5D301000000000000000010000000A65419D96CF4C347B8B3B5A340753291",
"reminderMinutesBeforeStart": 15,
"isReminderOn": true,
"hasAttachments": false,
"subject": "Sky Meeting",
"bodyPreview": "Join online meeting",
"importance": "normal",
"sensitivity": "normal",
"isAllDay": false,
"isCancelled": false,
"isOrganizer": true,
"responseRequested": true,
"seriesMasterId": null,
"showAs": "busy",
"type": "singleInstance",
"webLink": "https://outlook.office365.com/owa/?itemid=AAMkADVmMzE2MjY0LTZkOGYtNGI4MS1iNWMxLTljYzg3MWY5MWQxMQBGAAAAAABZMfR36TVMQ6yunaqZPvVRBwAF9fKWjhbKTIB6dNkgJcvkAAAAAAENAAAF9fKWjhbKTIB6dNkgJcvkAAClFy2jAAA%3D&exvsurl=1&path=/calendar/item",
"onlineMeetingUrl": "https://meet.lync.com/example/joyce/NLSD7Y62",
"responseStatus": {
"response": "organizer",
"time": "0001-01-01T00:00:00Z"
},
"body": {
"contentType": "html",
"content": "Join online meeting"
},
"start": {
"dateTime": "2018-03-08T00:00:00.0000000",
"timeZone": "UTC"
},
"end": {
"dateTime": "2018-03-08T00:30:00.0000000",
"timeZone": "UTC"
},
"location": {
"displayName": "Online meeting"
},
"recurrence": null,
"attendees": [],
"organizer": {
"emailAddress": {
"name": "Joyce",
"address": "joyce#example.com"
}
}
}
Step 2. The onlineMeetingUrl in the response event object is null.
{
...
"onlineMeetingUrl": null,
...
}
The onlineMeetingUrl property is not writable. We will update the documentation to reflect this.
Add these params in the request body
"isOnlineMeeting": true,
"onlineMeetingProvider": "teamsForBusiness"
onlineMeetingUrl is null in response even while passing "isOnlineMeeting": true,
"onlineMeetingProvider": "teamsForBusiness"
after a successful payment I store the stripe id on a mysql table. With that id I would like to retrieve all the details stored in the stripe database.
So is it possible to resume a single payment by the stripe id?
Thanks
Here is the documentation you need to use: https://stripe.com/docs/api/php#retrieve_customer
Use the "customer retrieve" Stripe API call to retrieve details about the customer's purchase:
Stripe::setApiKey(Config::get('your_stripe_secret_key_here'));
$customer_object = Customer::retrieve(customers_stripe_id);
This will return the following JSON:
Stripe\Customer JSON: {
"id": "cus_7KJZQ8Z6jfSSMl",
"object": "customer",
"account_balance": 0,
"created": 1447172728,
"currency": "usd",
"default_source": "card_175evz2eZvKYlo2CKoS2WEDk",
"delinquent": false,
"description": "Bingo|www|0c1234567890",
"discount": null,
"email": null,
"livemode": false,
"metadata": {
},
"shipping": null,
"sources": {
"object": "list",
"data": [
{
"id": "card_175evz2eZvKYlo2CKoS2WEDk",
"object": "card",
"address_city": null,
"address_country": null,
"address_line1": null,
"address_line1_check": null,
"address_line2": null,
"address_state": null,
"address_zip": null,
"address_zip_check": null,
"brand": "Visa",
"country": "US",
"customer": "cus_7KJZQ8Z6jfSSMl",
"cvc_check": "pass",
"dynamic_last4": null,
"exp_month": 5,
"exp_year": 2016,
"funding": "credit",
"last4": "4242",
"metadata": {
},
"name": null,
"tokenization_method": null
}
],
"has_more": false,
"total_count": 1,
"url": "/v1/customers/cus_7KJZQ8Z6jfSSMl/sources"
},
"subscriptions": {
"object": "list",
"data": [
],
"has_more": false,
"total_count": 0,
"url": "/v1/customers/cus_7KJZQ8Z6jfSSMl/subscriptions"
}
}
Here is Stripe's version of the API call:
\Stripe\Stripe::setApiKey("your_secret_key");
\Stripe\Customer::retrieve("the_customers_id");
Make sure to import the \Stripe classes by adding this at the top of your Model or Controller:
use Stripe\Customer;
use Stripe\Stripe;
if you want to use "Stripe" instead of \Stripe\Stripe and \Stripe\Customer prefixes)