What's the relationship between renderer process and BrowserWindow?
Whether they can be considered the same thing?
In the context of Electron, the renderer process and BrowserWindow are closely related.
A BrowserWindow is a Chromium-based window that is displayed in the user's desktop. It is created and controlled by the main process of the Electron app. Each BrowserWindow instance has its own renderer process, which is responsible for rendering the web page displayed in the window.
The renderer process is a separate process from the main process and runs in a separate thread. It is responsible for handling the web page's JavaScript, HTML, and CSS, as well as interacting with the web page's DOM (Document Object Model). It communicates with the main process using Inter-Process Communication (IPC) to handle events such as user input and window resizing.
In summary, the renderer process is responsible for rendering the web page in a BrowserWindow, while the BrowserWindow is responsible for creating and managing the window on the user's desktop. The main process is responsible for creating and managing the BrowserWindow instances and the renderer processes associated with them.
Related
I want to check the health of the electron application.
Is there any possible way to handling http server side request inside electron JS application other than using node module like express?
i don’t want to use node modules like express inside front end components. So is there any inbuilt functionality that help to monitor the health state of electron application
In progressive web application (PWA), it is said to make a web app fully PWA-compliant, I need to have a manifest file.
(1) But what happens if my web app registers a service worker but I didn't define a manifest file? Any typical examples?
(2) Is it correct that service worker is a technique used in PWA, but is not necessarily exclusive to PWAs (i.e. non-PWA web apps could have service workers as well)?
PWAs are Progressive Web Apps which means you progressively enhance your site with the features you need.
If you want your site to be installable you'll need a web manifest.
If you want your site to cache resources on the device or work offline you'll need a service worker.
Those pieces work independently but complementary and you can pick and choose them at your whim.
Answering to the first part:
It won't prompt user for add to home screen as this is one of the
requirements for PWA, but PWA isn't limited to it. So if you have
Service worker registered, you will get all the other functionalities of PWA other than Add to home Screen.
In precise, loading a
manifest files tell browser that our website is an application
Answer to your other questions. Can't see any other use of the
Service Worker other than PWA, as Service Worker is a proxy, sits between the user and N/W request and decides very cleverly if the internet is available or not or whether the SW should intercept the
n/w request or not. So, soon you register SW it automatically counts towards PWA.
Major components of PWA are:
Adding a Web App Manifest
Adding a Service Worker (SW)
Caching and serving Static assets
Serving Cached Contents
Dynamic Caching
Out of these 5 steps, you can achieve 2,3,4,5 with the help of SW. Adding a web app manifest is more like an intimation and giving your website a more native look/feel regardless of desktop or mobile device. cheers :)
I have a long running operation using multi-threading to process some data. I need to provide a User Interface to allow user to start the process and check progress of the long running operation.
It is easy provide progress report with windows based application (WPF) using backgroundWorker.ReportProgress(). However, I have to create web based UI using Angular 2/MVC.
What is the best way to achieve this using Angular 2/MVC/Web Api?
Edit: I do not have a database to store results temporarily.
Thanks.
I know that a web browser is a GUI control But here is a problem:
I have a Windows service and I want it to grab a web page from Internet and let the JavaScript code to be executed and then processes the result on that page and keeps Cookies.
is there any way to simulate Web Browser or Create a Hidden window and assign a web browser to it from inside windows service ?
Using a GUI control in session 0 will likely fail. You can enable the Allow service to interact with desktop setting for the service. This won't result in the control being visible on the desktop, but it will let the interactive desktop API calls in the service succeed. Whether this works for you, I cannot predict. It's your best hope of getting something out of a GUI control in a service. But do not be surprised if even that does not work.
What you should do though is to perform your tasks without a GUI at all. There are headless browsers that are designed for use in services/daemons. For instance PhantomJS, but there are others. This old question has an excellent set of links: Headless Browser and scraping - solutions
I'm just curios whether such possibility exists.
Here what I mean:
Suppose I have an ASP.NET MVC site. And some classical .exe application which stores this site as a resource.
When user starts this application, server runs in the context of the process (without any outside exposure) and processes the requests from the same process. At the same time client sees generated content in a browser-like window.
You'll need
IIS Hostable Web Core to host website
http://blogs.msdn.com/b/carlosag/archive/2008/04/14/hostyourownwebserverusingiis7.aspx
WebBrowser Control to access site from your windows app
http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx
http://msdn.microsoft.com/en-us/library/aa752041(v=vs.85).aspx