Not able to get a desktop kind of a window - electron.net

On windows, when I run the electron.net app see a desktop-style window. However, on a Mac, I see that the same app is being shown in a browser.
var browserWindow = await Electron.WindowManager.CreateWindowAsync(new BrowserWindowOptions
{
Width = 1000,
Height = 600,
Show = false
});
browserWindow.OnReadyToShow += () => browserWindow.Show();
browserWindow.SetTitle("Electron.NET API Demos");
How could I avoid giving the browser feel for a electron.net app on a Mac?
It's an asp.net core 3 based app using electron.net.

On the Mac, I updated the electron-builder package using npm and it works.

Related

How to determine if an app is at the side of the stage manager in macOS Ventura

I have a JavaScript for Automation (JXA) function to determine which state a macOS app is currently in:
function getAppState(appName) {
if (!Application(appName).running()) {
return "APP_NOT_RUNNING";
}
const proc = Application("System Events").processes.byName(appName);
if (proc.windows.length === 0) {
return "APP_RUNNING_NO_WINDOWS";
}
if (proc.frontmost()) {
return "APP_RUNNING_FRONTMOST";
}
// with Ventura stage manager, it seems this is all we can find out;
// proc.miniaturized/visible/zoomed won't tell us if the app has an open window on the
// screen or not
return "APP_RUNNING";
}
It tells me if an app is currently running, and if it is, if it has any application windows and if it is currently at the front.
I would like this script to return another value, let's call it APP_RUNNING_AT_THE_SIDE when the app is shown at the side in Stage Manager mode in macOS Ventura. I mean apps in a state like those in this screenshot:
I've tried to check the properties miniaturized, visible, zoomed of both Process and Application.Window with no luck – they always return the same values, no matter if an app is shown fully on the screen or small at the side.
Is there a way to determine if an app is at the Stage Manager side with JXA? Or perhaps someone knows an AppleScript solution that I can port to JXA?

Xamarin Forms (PCL) Youtube Player loading in a WebView

We have YouTube trailers that we want to run on our Xamarin Forms (PCL) project.
We have try'd everything but somehow there is not a good Youtube player out there :(
So now we are loading the Youtube trailers in a WebView so that it runs on the Android + iOS.
This is how we load the trailers in our WebView component:
var apiRequest = "https://www.youtube.com/embed/GYmm9qNwd_s?html5=1&autoplay=1&loop=1&rel=0&showinfo=0&controls=1";
var webView = new WebView();
webView.Source = apiRequest;
webView.MinimumWidthRequest = 200;
webView.MinimumHeightRequest = 200;
webView.HorizontalOptions = LayoutOptions.FillAndExpand;
webView.VerticalOptions = LayoutOptions.FillAndExpand;
var stackLayout = new StackLayout();
stackLayout.Children.Add(webView);
stackLayout.HorizontalOptions = LayoutOptions.FillAndExpand;
stackLayout.VerticalOptions = LayoutOptions.FillAndExpand;
grid.Children.Add(stackLayout);
this.Content = grid;
But somehow the Trailer is running on iOS and Android but the Autoplay is not working and the related movies still show up!
So my question is :
Is there a way to set the Autoplay on the Xamarin Forms platforms?
Why does the autoplay function won't work?
Autoplay on most mobile platforms (Android, iOS) gets blocked to avoid poor user experiences - video should only play following a user action.
Like in Andriod, Auto-play is disabled since Android SDK 17.
You can check this question to get more information Android webview html5 video autoplay not working on android 4.0.3

How to create media down-loader like whats app, telegram in Xamarin forms? and how to create whats app UI

I am creating social application in Xamarin.Forms where I want to implement media downloader to download image and video. currently I am using Xamarin.FFImageLoading.Transformations nuget to load image.
how to create Whatsapp UI using xamarin forms for android and iOS?
I want to implement manual media download functionality with progress shown in images thumbnail like whatsapp, telegram mobile app.
var cachedImage = new CachedImage() {
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.Center,
WidthRequest = 300,
HeightRequest = 300,
CacheDuration = TimeSpan.FromDays(30),
DownsampleToViewSize = true,
RetryCount = 0,
RetryDelay = 250,
TransparencyEnabled = false,
LoadingPlaceholder = "loading.png",
ErrorPlaceholder = "error.png",
Source = "http://loremflickr.com/600/600/nature?filename=simple.jpg"
};
https://github.com/luberda-molinet/FFImageLoading
suggest any approach to achieve above functionality in Xamarin.Forms or Xamarin.Android or Xamarin.iOS.
#Sumeet what I understood is as below please correct me if I am wrong :-
There would be 4 options to app user as below :
If user selects auto download option...
Media in the app would get downloaded automatically when we open app, or in the background the media could get downloaded.
If user select download over WiFi option from user settings
Media would get downloaded once user gets connected to WiFi.
If user selects download media manually option from settings
App media should only get downloaded once user select particular media for download
If user selects do not download option
User will not be allowed to download the media contents in the app.
For file downloading using Xamarin Forms there is a nice article by Damien Aicheh :
https://damienaicheh.github.io/xamarin/xamarin.forms/2018/07/10/download-a-file-with-progress-bar-in-xamarin-forms-en.html
For circular progress dialog you can refer this article by James Montemagno :
https://blog.xamarin.com/using-custom-controls-in-xamarin-forms-on-android/
You need to create your custom xaml where you place your loader on top of a view and update the UI based on the file downloaded progress.
Hope this helps!!!
If you want a true progress bar, you will likely need to take over the image download yourself and build a custom control. You may be able to extend or modify CachedImage, but not sure if they provide hooks into their stream downloader (which you would want to replace with one that reports progress).
Another option would be to just show a nice animation with something like this https://github.com/DanielCauser/XamarinFFImageLoadingAndLottie
Found to create UI like Whats app and functionality using Xamarin Forms check below link
https://github.com/egbakou/WhatsAppUI
and below link is for some good looking UI in Xamarin Forms for android and iOS
https://github.com/jsuarezruiz/xamarin-forms-goodlooking-UI

CKEditor version 4.5.8 disabled in IE 11 & Edge

I'm building a hybrid mobile app with the Ionic framework for android, ios, windows 8.1 and windows 10.
I was searching for a good rich text editor and came across CKEditor.
I've tested the editor on an Android and iOS device and it works perfectly.
When i try the editor on a windows device with Internet Explorer 11 or Edge, the editor is disabled (see screenshot below).
The console shows the following error on page initialization:
APPHOST9602: 'javascript:' is an invalid attribute value and will be
ignored. Don’t use 'javascript:' URIs in the local context.
The HTML code i use is :
<div id="ckeditor" ckeditor="options" ng-model="survey.Comments" ready="onReady()"></div>
And my controller:
angular.module('app.parts')
.controller('CommentsController', function ($scope, App, $ionicHistory, Survey) {
$scope.survey = Survey.getSurvey();
// Editor options.
$scope.options = {
language: 'nl',
allowedContent: true,
basicEntities: false,
resize_enabled: false,
startupFocus: true
};
// Called when the editor is completely ready.
$scope.onReady = function () {
// ...
};
});
I use the CKeditor library in combination with lemonade's ckeditor angularjs wrapper
According to the CKEditor specs, the editor should be working on IE 11 and Edge.
To be clear, the CKEditor is disabled on a Windows device (Surface Pro 3 with Windows 10 and laptop with Windows 8.1). When I test CKEditor in Internet Explorer 11 or Edge webbrowser on my laptop, it works fine.
I've also tested with CKEditor < 4.4.8 and using the following code snippet:
CKEDITOR.env.isCompatible = true;
Unfortunately, no success.
Anyone else had or has the same issue and knows how to fix it?
Thanks in advance

Open Web link programmatically in IE - non-Metro mode

Is there a way to open a link in IE (non-metro mode) from my metro app programmatically?
For metro applications users are in control of the applications that launch for uri and files.
To browse to a webpage (JavaScript but the C# is similar):
var uri = new Windows.Foundation.Uri("http://www.microsoft.com");
Windows.System.Launcher.launchUriAsync(uri).then(function () { });
To launch other apps you should look at the Windows.System.Launcher class.

Resources