How to properly implement and test homepage in editor (Docs) addon - google-apps-marketplace

I am creating Google Workspace Editor add-on for Docs and Slides. My add-on is rejected by Google Workspace Marketplace team with message No homepage card is provided for the host app: Google Slides/Docs
According to documentation the homepage card is optional, therefore I initially did not implement it as my addon has no sense outside to document or slide.
https://developers.google.com/apps-script/add-ons/editors/gsao/building-editor-interfaces?hl=en#accessing_the_add-on_ui
Now I am trying to add it in appscript.json:
{
"addOns": {
"common": {
"homepageTrigger": { "enabled": true, "runFunction": "onHomepage" },
...
}
And my onHomepage trigger is not called when I run the add-on functions or install it.
Please advise on where the homepage is displayed in Docs/Slides and how to test this function.

Related

What is the correct way add a protocol to the macOS info.plist using electron-builder?

I need to be able to launch my Electron app from the the browser (like sign in to Slack does). I know that I can add my protocol name to my Electron app using app.setAsDefaultProtocolClient(protocol[, path, args]) in Electron.
Then in electron-builder, I can use the package.json config build.mac with the extendInfo property to define "The extra entries for Info.plist". This however is the only instructions the docs give on how to use it.
What is the correct way add a protocol to the macOS info.plist using electron and electron-builder config build.mac.extendInfo and be able to use it as described?
(Posted a solution on behalf of the question author to move it to the answer space).
It now works with the following - I have added this to my Electron package.json:
"protocols": {
"name": "my-app",
"schemes": [
"my-app"
]
},
"mac": {
"target": "dmg",
"extendInfo": "my-app"
},
I have this in the electron.js:
app.setAsDefaultProtocolClient('my-app');
And this in my React browser client app code to launch the application from the browser:
document.location = 'my-app://open?url='
This question relates to how custom schemes are used to receive OAuth responses, as in my code sample which you can run locally, then use deep linking etc:
Code
Blog Post
Points of interest:
An interstitial web page returns control to the browser app - see this page
My package.json exposes the scheme for Electron deployment
This should give you something to compare against. Here is the key code:
INTERSTITIAL WEB PAGE INVOKING APP
window.addEventListener('DOMContentLoaded', function() {
var redirectUri = 'x-mycompany-desktopapp:/callback';
if (window.location.search) {
redirectUri += window.location.search;
}
document.getElementById('continueButton').onclick = function() {
window.location.href = redirectUri;
};
}
REGISTERING THE SCHEME
This gets picked up by Electron packager and included in platform specific binaries, resulting in OS specific registration:
"build": {
"protocols": {
"name": "finaldesktopapp",
"schemes": [
"x-mycompany-desktopapp"
]
}
},
RECEIVING NOTIFICATIONS
This enables the following code to work in the main side of the app, as specified in the main.ts file:
app.setAsDefaultProtocolClient(this._configuration.oauth.privateSchemeName);
Finally you register a callback that can parse the URL and take whatever is the appropriate action - completing a login in my case.
private _receiveNotificationInRunningInstance(privateSchemeUrl: string) {
}
The mechanics are a little tricky and the notification is received differently on macOS to Windows / Linux. See this source file and its comments which explain the details.

Keep website-tab navigation within MSTeams

I'm creating an app that should go in the left app-bar that should load our intranet (hosted on sharepoint online).
I followed the documentation and created a package; when I add it to the sidebar it does load the first page of the site.
Any link I click will open in the default browser, instead of in the teams client itself.
Is it possible to either directly open the browser, either to keep the navigation in Teams?
{"$schema":"https://developer.microsoft.com/en-us/json-schemas/teams/v1.9/MicrosoftTeams.schema.json",
"version":"1.0.0","manifestVersion":"1.9","id":"abb685ff-xxxx-4d9c-97ec-875b5ec946fd",
"packageName":"com.package.name",
"name":{
"short":"xxxx",
"full":"xxxx"
},
"developer":{
"name":"xxxx",
"mpnId":"",
"websiteUrl":"https://zzz.com",
"privacyUrl":"https://zzz.com/privacy-statement",
"termsOfUseUrl":"https://zzz.com/disclaimer"},
"description":{
"short":"access to xxx Intranet",
"full":"access to xxx Intranet"
},
"icons":{
"outline":"outline.png",
"color":"color.png"
},
"accentColor":"#add1cb",
"staticTabs":[
{
"entityId":"4d62815a-xxxx-4b36-9ba3-79e67797963d",
"name":"xxxx",
"contentUrl":"https://xxxx.sharepoint.com",
"websiteUrl":"https://xxxx.sharepoint.com",
"scopes":["personal"]
},
{
"entityId":"about",
"scopes":["personal"]
}],
"validDomains":[]
}
It seems like it is by design and nothing can be done. You can try adding SharePoint directly as a tab in Teams

Your first extension - official Firefox extension tutorial not working

I wanted to try learning how to make a browser extension and tried doing the first official tutorial https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Your_first_WebExtension
When following everything here and going into a mozilla.org domain the extension does not put a red border around the site. It basically does nothing. (I know that content scripts are disabled on addon.mozilla.org)
I've carefully followed each step of the tutorial.
Here's the repository for the tutorial : https://github.com/mdn/webextensions-examples/tree/master/borderify
I just want to verify if I'm the only one with who this tutorial does not work.
The tutorial is fine. You can try changing it to another site and test again. For example:
{
"description": "Adds a solid red border to all webpages matching mozilla.org. See https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Examples#borderify",
"manifest_version": 2,
"name": "Borderify",
"version": "1.0",
"homepage_url": "https://github.com/mdn/webextensions-examples/tree/master/borderify",
"icons": {
"48": "icons/border-48.png"
},
"content_scripts": [
{
"matches": ["*://*.example.com/*"],
"js": ["borderify.js"]
}
]
}
Then go to https://example.com/ to test.
I had the same problem: the Borderify example was not working. In my case, it was a problem of my default browser's privacy settings.
Try going to Firefox settings and see if the option Always use private mode is disabled.
Alternatively, after loading the extension in debugging mode, go to the Add-Ons section and enable the extension for private windows.

Xamarin Forms Deep Linking

I have tried getting Xamarin Forms deep linking to work by following the example in https://learn.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/deep-linking.
It tells me I must have a version of my app live on Google Play, and I must also have a companion website registered with Google.
How am I supposed to test, develop, and debug my app if it has to already be published for this to work?
Note that I don't want app indexing, I just want deep linking. This all seems a bit involved - why do I even need a website?
All I basically want to do is authenticate the user to Strava via OAuth and handle the redirect URI.
Is there a simple example of how to get just deep linking to work, in such a way as it could handle the redirect URI from Strava?
I seem to have discovered a solution that works which is to simply put an IntentFilter on the MainActivity of my app:
[IntentFilter(
new[] { Intent.ActionView },
Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable },
DataSchemes = new[] { "<my package name>" },
DataHosts = new[] { "redirect.authorize.strava.<my package name>" }
)]
When I do this, it successfully calls OnAppLinkRequestReceived when strava fires the redirect URL with the deep link.
Wouldn't have known that from any docs though....

Firefox Android Addon: Add search engine

I've created an extension with the following manifest to add a search engine to Firefox.
{
"manifest_version": 2,
"name": "Google Browse by Name search engine",
"description": "Adds a search engine that searches Google using its Browse by Name feature",
"version": "1.0",
"applications": {
"gecko": {
"strict_min_version": "55.0"
}
},
"chrome_settings_overrides": {
"search_provider": {
"name": "Browse by Name",
"search_url": "https://www.google.com/search?sourceid=navclient&gfns=1&q={searchTerms}",
"keyword": "bbn",
"favicon_url": "https://www.google.com/favicon.ico",
"is_default": false
}
}
}
This works as expected on Firefox desktop, adding an option to the list of enabled search engines. However, it does not appear to work on Firefox Android, I assume because chrome_settings_overrides is not supported on Android.
Addons making use of the legacy API appear to work correctly (e.g. Startpage), adding search engines to the Android browser, but since Firefox is dropping support for legacy (non webextension) extensions this is no longer a solution.
What is the correct way to add a search engine to Firefox for Android using an addon?
I am aware that users can add a search engine available on a webpage by long-pressing on its search field, but I would like to offer an extension to automatically install the search engine (and save users from having to find a page offering the correct search field).

Resources