Host Permissions required for SelectionText of info object in Thunderbird 68? - thunderbird

The documentation for menus API of Thunderbird 68 says :
The following properties are only set if the extension has host permissions for the given context: linkUrl, linkText, srcUrl, pageUrl, frameUrl, selectionText.
In my manifest.json, following are the list of permissions i had requested from host:
"permissions": [
"menus",
"activeTab",
"tabs",
"<all_urls>"
],
"content_scripts": [
{
"matches": ["<all_urls>"]
}
]
But, when a text is selected in content of email, the selected text is not being included in the info object.
{"menuItemId":"open_link","parentMenuItemId":"context_customlinks","editable":false,"modifiers":[],"button":0}
Earlier the selection of text worked fine in my XUL based extension. But, after porting it to WebExtension the selection text is not being passed leading to missing functionality in my extension.
I tried searching relevant information in all the places (Thunderbird Documentation, Webextension Documentation, GitHub, Stackoverflow, Google, etc.,) to get the idea of host permissions required for info.SelectionText, but the information couldn't be found anywhere.
Requesting help in resolving this issue.

Related

Remove all phones from Google Directory User

I am attempting to remove all phones from a Google Directory User, using the Admin Directory API directory_v1 > directory.users.update.
I am sending the following request body:
{
"phones": []
}
but this seems to have no effect.
How can I achieve this?
Set it to null:
{
“phones”:null
}
See the note all the way at the bottom of the API documentation you linked to in the ‘update’ section.

How to mark up a Person's websites in Schema.org markup

I'm using Person to represent my user's profiles. Users are able to add links to other websites, e.g. their personal website, their Twitter profile, or just the website of an important project of theirs.
The latter is the reason I'd prefer not to use the sameAs property - plus, I'd like to be able to show the names they give those websites as well.
What property would I be able to use?
Although #unor removed it from the question, I did note that I am marking this up using microdata - which means I can't use #reverse like suggested in this answer.
What I ended up doing for now is abusing sameAs for this, and wrapping it in a Role so I could use roleName to specify the relation of the website to the profile. So in JSON:
{
"sameAs": [
{
"roleName": "My Twitter profile",
"sameAs": "https://twitter.com/example"
},
{
"roleName": "10001 innovations in scholarly communications",
"sameAs": "http://innoscholcomm.silk.co/"
}
]
}

Why does my Google Home send an empty location field in an Actions On Google webhook request?

I have been following the template on GitHub for integration with the locations API the Actions On Google offers.
It works fine in the simulator and even on the Google Assistant for Phones, i.e. I either get a lat/lon pair or a coarse location provided depending on whether the device has a screen or not.
However, on my physical Google Home device, the location field in the response is empty and I cannot figure out why.
In one step, I request the permission with
app.askForPermission(Responses.permissionReason(), app.SupportedPermissions.DEVICE_COARSE_LOCATION);
In my follow-up step I then check if the permission was granted and continue:
if (!app.isPermissionGranted()) {
return Promise.reject(new Error('Permission not granted'));
}
const location = app.getDeviceLocation();
If I start this conversation from my Google Home, however, getDeviceLocation is undefined.
Looking at the request, the permission is clearly granted but the location field is empty:
<snip>
"user": {
"userStorage": "{\"data\":{}}",
"lastSeen": "2018-01-20T10:50:01Z",
"permissions": [
"DEVICE_COARSE_LOCATION"
],
"locale": "en-GB",
"userId": "<redacted>"
},
"device": {
"location": {}
},
</snip>
Full request here.
I couldn't find any information in the documentation about why this would happen. Could someone fill me in?
Check to make sure that your Google Home has a location set for it in the configuration. If you have configured it for voice recognition, make sure it is your voice being recognized and not a generic account.

Matching Google Cloud Storage ID to a user email address

I'm looking for a way to determine who uploaded a file to a Cloud Storage bucket. All of the users with access to write to the bucket are authenticated users in the same G Suite domain.
The object ACL in Cloud Storage shows an owner identifier string which looks like the following:
{
"entity": "user-84fac329bceSAMPLE777d5d22b8SAMPLE77d85ac2SAMPLE2dfcf7c4adf34da46",
"entityId": "84fac329bceSAMPLE777d5d22b8SAMPLE77d85ac2SAMPLE2dfcf7c4adf34da46",
"role": "OWNER"
}
However, it does not appear that there is an easy way to map this ID back to a user's email address (or to determine the Cloud Storage ID for a user whose email I know, except by using that user account to upload a file and querying the object ACL).
Is this true? Or am I just not seeing the way to do this?
Thank you for the help!
Although I can't give you an specific timeline, we're actively working on deprecating canonical ids. This should no longer be a problem in the near future.
In the meanwhile, there are.. options.
First: A user can find their canonical ID on this page (Unfortunately it is going to make you pick a project, since the page also shows the canonical ids for the project roles).
https://console.cloud.google.com/storage/settings
However, if you really need to find out the email address for a random canonical id you should be able to do this somewhat ugly workaround.
1) Add the user to a bucket policy via the ACL API
gsutil acl ch -u <canonical_id>:READ gs://<bucket>
2) Fetch the bucket IAM policy
gsutil iam get gs://<bucket>
The entry should show up as an email address.
{
"bindings": [
{
"members": [
"projectOwner:<project-id>",
"projectEditor:<project-id>",
],
"role": "roles/storage.legacyBucketOwner"
},
{
"members": [
"projectViewer:<project-id>",
"user:<user email here>"
],
"role": "roles/storage.legacyBucketReader"
}
],
"etag": "CAI="
}
Try getting the ACLs again. I just tried today 07/05/2017 and the returned ACLs included email address. It would appear Google has updated the API, replacing the old Google Cloud Storage ID with the user's email address.
{
"email": "email#domain.com",
"entity": "user-email#domain.com",
"role": "OWNER"
}

Graph API direct message for page: how to retrieve link to attached file

I need to store the link to a file attached to a direct message (for a page, retrieved with "/conversations"). How can I do that?
I know how to get the link of an image. The JSON-object for an image ("attachments") contains the tag "image_data", which contains the tags "url" and "preview_url" for accessing the image.
For attached files (in my case e.g. a PDF), FB only sends "id", "mime_type", "name" and "size", but no additional data. Example:
"id": "m_id.158623824339344"
....
"attachments": {
"data": [
{
"id": "7b84fd4c0f18fb4060ae0fe0dcfeb42e",
"mime_type": "application/pdf",
"name": "Attachment1.pdf",
"size": 80798
}
]
}
But when I log into FB as a user and click the attachment in the browser, I get this link:
https://www.facebook.com/ajax/messaging/attachment.php?attach_id=<attach_id>&mid=id.<mid>&pageid=<pageid>&ext=<ext>&hash=AQCafpYeZj2pSjRk
By trial and error I found out that it is possible to access the file without the "hash" and "ext"-part. This means that in theory I am able to generate this link in my application ("attach_id" and "mid" are provided with the message and I know my pageid).
But this seems to be very unreliable. This link might change anytime, breaking my application.
I searched a lot but couldn't find any documentation about this. Does anybody know a better solution? Or can someone point me to some documentation regarding this issue?
Thanks a lot!
Barbara
Sorry this is not available as of v2.5.
If this becomes a new feature in the future, you should be able to find it in the documentation:
https://developers.intern.facebook.com/docs/graph-api/reference/v2.5/message/attachments