How to call picture-in-picure when clicking the extension icon in Firefox? - firefox

This question was migrated from Super User because it can be answered on Stack Overflow.
Migrated 17 days ago.
I'm trying to make a simple extension that does what "Ctrl+Shift+]" does on any page when you click it.
So far I have manifest:
{
"manifest_version": 2,
"name": "Picture-in-Picture Button",
"version": "1.0",
"description": "Opens the video on the page in a native Picture-in-Picture window.",
"browser_action": {
"default_icon": "icon.png"
},
"permissions": [
"webNavigation",
"tabs"
]
}
and background:
browser.browserAction.onClicked.addListener(function(tab) {
browser.tabs.executeScript({
code: 'document.querySelector("video").requestPictureInPicture();'
});
});
but nothing happens

Related

MS Teams Bot - task/fetch URL not loading in web/desktop app but loading in android app

I'm trying to display an URL upon invoke (task/fetch) via MS Teams bot. The URL is loading and working perfectly fine on android/ios app. But it is not loading at all in web/desktop app. The app has been in production for some time now and I recently updated the app manifest with valid domains for making the URLs load in Teams.
Also I tried the same manifest/backend with another test app and URLs are loading fine in web/mobile app. Not sure what am I missing here.
Please find below my task/fetch response and manifest details.
task/fetch response
{
"task": {
"type": "continue",
"value": {
"title": "Task Module Test",
"height": 1200,
"width": 1000,
"url": "https://www.contoso.com/msteams/taskmodules/newcustomer",
"fallbackUrl": "https://www.contoso.com/msteams/taskmodules/newcustomer"
}
}
}
My App Manifest (have edited some sensitive info but the structure of the manifest is intact)
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.8/MicrosoftTeams.schema.json",
"manifestVersion": "1.8",
"version": "1.0.0",
"showLoadingIndicator": true,
"id": "some-id",
"packageName": "com.example.bots.msteams",
"developer": {
"name": "Test",
"websiteUrl": "https://www.example.com",
"privacyUrl": "https://www.example.com/policy",
"termsOfUseUrl": "https://www.example.com/terms"
},
"icons": {
"color": "color.png",
"outline": "outline.png"
},
"name": {
"short": "Test Short",
"full": "Test Long"
},
"description": {
"short": "Short desc",
"full": "Long desc"
},
"accentColor": "#FFFFFF",
"bots": [
{
"botId": "some-id",
"scopes": [
"personal"
],
"supportsFiles": true,
"isNotificationOnly": false
}
],
"permissions": [
"identity",
"messageTeamMembers"
],
"validDomains": [
"www.contoso.com"
]
}
URL successfully loading on Phone app
URL not loading on web/desktop app
Happy to provide any other info if needed!
Ok, found the fix (but I have no clue why it works). I removed showLoadingIndicator property from the manifest and the URLs are loading fine now.
I couldn't find much help on what that property does from MS docs.
Glad that you found the solution and thanks for posting it back to help other community members.
When you set showLoadingIndicator to true, as a mandatory step you need to call microsoftTeams.appInitialization.notifySuccess() to notify Teams that your app has successfully loaded.
The behavior on mobile clients is not configurable through the native loading indicator property. Mobile clients show this indicator by default across content pages and iframe-based task modules.
Here is documentation on Show Loading Indicator.

NW.js Windows 10 Taskbar icon shows always default

In Windows 10 the taskbar is not showing my custom-made icon. I am using the latest (at the moment of writing) 0.51.1 version of nw.js and the taskbar icon always defaults doesn't matter what I am doing. Even though the .exe icon is changing on the build and behaves as expected.
Have anyone managed to solve this issue? I read almost all issues log on this topic on the official nw.js Github page but it doesn't help and seems like the issue still happens for some users.
here is my package.json file
{
"name": "com.domain.product",
"version": "0.1.0",
"build": {
"nwVersion": "0.51.1",
"nwFlavor": "normal",
"strippedProperties": [ "scripts", "devDependencies", "build", "chromium-args"],
"mac": {
"name": "Product Name",
"icon": "ProductName.icns"
},
"win": {
"name": "ProductName",
"icon": "icon/ProductName.ico"
},
"output": "../build"
},
"window": {
"width": 314,
"height": 660,
"frame": false,
"transparent": true,
"toolbar": false,
"resizable": false
},
"main": "index.html",
"node-remote": [ "<all_urls>"]
}
Here is a more complex example, but look for how icons are handled in the the window setting and in the build settings:
https://github.com/nwutils/nw-vue-cli-example/blob/master/package.json
You need to add the 'window.icon' property to your package.json. Something similar to:
"window": {
"icon": "./build/my-icon.png"
},
See the Manifest format documentation for more details: https://nwjs.readthedocs.io/en/latest/References/Manifest%20Format/#icon

Microsoft Teams - Custom App, can't load Webpage/2nd Tab

I am creating a Custom Teams App, that simply loads a few webpages:
https://www.itcompany.co.nz
https://itcompany.itclientportal.com/ClientPortal/Login.aspx
Note: ITCOMPANY is just a placeholder so I could create this post publically, I can get it to load the itcompany.co.nz , but all I get is a blank screen when attempting to navigate to the 2nd tab (https://itcompany.itclientportal.com/ClientPortal/Login.aspx).
Note: the ClientPortal is just a login screen, there is no SSO etc.
Not sure what I am doing wrong here, hoping I can get some assistance on what I could be missing.
Note: If I change the URL to: https://www.google.co.nz, it does the same thing (doesn't load). refused to connect error, these URLs were added automatically to the allowed domains list by App Studio.
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.8/MicrosoftTeams.schema.json",
"manifestVersion": "1.8",
"version": "1.0.0",
"id": "05db8546-1517-4306-8dda-7278e8272226",
"packageName": "com.microsoft.teams.m365lp",
"developer": {
"name": "IT Company Limited",
"websiteUrl": "https://www.itcompany.co.nz",
"privacyUrl": "https://www.itcompany.co.nz",
"termsOfUseUrl": "https://www.itcompany.co.nz",
"mpnId": "CA01101011"
},
"icons": {
"color": "color.png",
"outline": "outline.png"
},
"name": {
"short": "IT COMPANY",
"full": "At IT COMPANY, we solve your IT problems!"
},
"description": {
"short": "IT COMPANY",
"full": "At IT COMPANY, we solve your IT problems!"
},
"accentColor": "#8B8B8B",
"staticTabs": [
{
"entityId": "201911011330",
"name": "IT COMPANY",
"contentUrl": "https://www.itcompany.co.nz/",
"websiteUrl": "https://www.itcompany.co.nz/",
"scopes": [
"personal"
]
},
{
"entityId": "201911011335",
"name": "IT COMPANY Support Portal",
"contentUrl": "https://itcompany.itclientportal.com/ClientPortal/Login.aspx",
"websiteUrl": "https://itcompany.itclientportal.com/ClientPortal/Login.aspx",
"scopes": [
"personal"
]
}
],
"permissions": [
"identity",
"messageTeamMembers"
],
"validDomains": [
"www.itcompany.co.nz",
"itcompany.itclientportal.com",
"*.itclientportal.com",
"*.login.microsoftonline.com",
"*.sharepoint.com",
"*.sharepoint-df.com",
"spoppe-a.akamaihd.net",
"spoprod-a.akamaihd.net",
"resourceseng.blob.core.windows.net",
"msft.spoppe.com"
]
When you include a custom tab in an app in Teams, that tab is supposed to reference the Teams Javascript SDK. See specifically here:
Additionally, you need to add the Teams JavaScript client SDK to your page, and call microsoftTeams.initialize() after your page loads. Doing so will tell Teams to display your page, give you access to Teams-specific information (for example if the Teams client is running the dark theme), and allow you to take action based on the results.

Why doesn't this Firefox extension code work with prompt or alert for contextMenus?

I have the following background.js script:
browser.runtime.onInstalled.addListener(function () {
browser.contextMenus.create({
id: 'add-todo',
title: 'Add a todo',
contexts: ['page']
});
});
browser.contextMenus.onClicked.addListener(function (clickData) {
if (clickData.menuItemId === 'add-todo') {
var todoName = window.prompt('Add a todo')
alert(todoName);
}
});
And the following manifest.json
{
"manifest_version": 2,
"name": "Todo",
"version": "1.0",
"description": "Yet another todo app",
"browser_action": { "default_popup": "index.html" },
"permissions": ["contextMenus"],
"background": {
"scripts": [
"background.js"
]
}
}
I can see the context menu when I right click, but clicking it does nothing.
Oddly, when I open the extension via the browser action button, and it displays my popup.html, I can right click there and see a prompt dialog.
I use the same code in Chrome with the webextension-polyfill library and it works just fine.
What gives with Firefox?

own typo3 Extension doesn't get shown in Extension Manager (Composer Mode)

Im trying to set up my own Extension, for having in the all kind of changes to my Site. I set up typo3 9.5.5 via. Composer. The next step was building up my own extension. I followed the official docs and also added a composer.json, but it wont show up in the Extension Manager.
ext_emconf
<?php
$EM_CONF[$_EXTKEY]=[
'title'=>'MS Site Extension',
'description'=>'TYPO3 Site Extionsion',
'category'=>'plugin',
'author'=>'-',
'author_company'=>'-',
'author_email'=>'-',
'state'=>'alpha',
'clearCacheOnLoad'=>true,
'version'=>'0.0.1',
'constraints'=>[
'depends'=>[
'typo3'=>'9.5.5-9.9.99',
],
],
'autoload'=>[
'psr-4'=>[
'Ms\\MsSite\\'=>'Classes'
],
],
];
composer.json of the extension
{
"name": "ms/ms_site",
"type": "typo3-cms-extension",
"description": "MS SITE",
"license": [
"GPL-2.0+"
],
"keywords": [
"typo3",
"cms",
"ms",
"ms_site"
],
"version": "0.0.1-dev",
"require": {
"typo3/cms": "^9.5"
},
"autoload-dev": {
"psr-4": {
"Ms\\MsSite\\": "Classes/"
},
"replace": {
"hellotypo3": "self.version",
"typo3-ter/ms_site": "self.version"
},
"extra": {
"typo3/cms": {
"extension-key": "ms_site"
}
}
}
}
I'm a bit confused what I have to do now, the only place where my extension currently is, is at: typo3conf/ext, I configured it in the ext_emconf and the composer.json of the extension.
How do I solve this problem?
Edit: Hmm my console tells me that ms_site is added to PackageStates but I still can't see my Extension in my Backend ...
I'm just tilted and dumb, after over 4 hours of searching I recognized my mistake ... I just didnt uploaded the data to my server. :) I thought that I enabled an auto upload but it wasn't.

Resources