If I make a Progressive Web App (PWA), and I change the display in the manifest.json file to browser instead of the typical standalone preference people usually choose for PWAs, and the user opens the app and surfs to some third-party site outside my control, such as Reddit.com, does this app still have control such as the ability to add Javascript and CSS into the page kind of like a Chrome Extension would?
display: "browser" does not give you a stand-alone application. It opens in a normal browser tab/window
I'm not sure of any browser that will actually let that be installable, either.
That doesn't pass installability criteria for Chrome, for instance
As for being able to inject CSS and JS into other pages, no, you can't do that, with any display mode. It's just a website in a fancy display. PWAs aren't web views like in mobile apps, and the browser still owns the overall display context (rendering, extensions, etc…), not the installed app
Related
How does Zoom's website launch Zoom Meetings from Google Chrome?
Can I do it using JavaScript? If so, how can I do it?
Confirmation dialog box (Image)
It's not done with JavaScript, but with plain HTML. The way it works is, you create an <a> with an href attribute with a protocol other than the ones a browser usually recognizes - that is, other than http, https, etc.
If the user has installed an application that recognizes the protocol, the browser will try to open that application.
Similarly to Zoom, for IRC links, you can see something like:
Link
If you click on that link, and your machine has software installed that recognizes the irc protocol, that application can be opened directly by clicking on the link (possibly asking you if you want to open it first).
There are lots of different protocols for many different applications. They're quite handy for getting info on a web browser to an application on the user's computer.
For Zoom in particular, there's documentation on how to use its protocols here:
https://marketplace.zoom.us/docs/guides/guides/client-url-schemes
Making a link with a protocol registered to the zoom app on the operating system.
I'm creating a browser using Electron. And it opens websites using webview.
<webview id="View" useragent="..." src="https://example.com/" plugins="" preload="file/dir/webview.js" webpreferences="..." enableremotemodule="false" allowpopups=""></webview>
Now I've got a question, how can I detect when a website is trying to request access to something using JS/Node?
The explanation of my question:
Every website in chrome has its own settings, and they can be access by clicking Site settings in the page info window (look up in the picture) or by going to chrome://settings/content/siteDetails.
And the website settings include whether it can or can't access the user location, use the microphone, use JavaScript, Senf Notifications, etc.
How can I control those settings of websites in electron?
And how can I detect when a website is trying to gain access to one of those permissions? (just like how Wexond does, Wexond is a browser that is built using Electron)
I'm trying to create editor that lets you edit and changes your website.
So in the editor, I want to show iframe with a website.
Since there are many click-jack protections against website being opened withing iframe (headers and js), I't became impossible to do for some websites.
I came across the "webview" element, in the "Chrome app" documentation,
And I wonder, Is there any way to use "webview" or control that have the same behavior in chrome extension.
P.S: The only access I seek is using "postMessage".
Nope, there is no way to use <webview> outside a Chrome App.
So in theory you could make your editor an App.
What I'm looking to do is create a script that we could place on people's desktop to reset some settings back to where I want them for internal web application?
The script will need to reset everytime a user opens and closes the browser.
As far as my knowledge says, you cannot just edit settings of a browser without attaining user's permissions. So, it will be better to write a chrome plug-in application and ask you web application users to install that first.
You can identify the plug-in status in your web application.
I'm working on an HTML5 application that should be able to run in a lot of different environments - most desktop web browsers, mobile web browsers, and as an application saved to an iOS device.
The problem is that it opens multiple separate pages using target="_blank", mostly for exporting or printing data, which in an iOS web application blows away the current window and leaves the user unable to return. A simple link back isn't a solution, as the main page has more state in it than can be reasonably passed around. Is there a way for iOS mobile applications to open their pages as new tabs in mobile Safari?
If you are speaking about adding your web application to home screen and run it in standalone mode using:
<meta name="apple-mobile-web-app-capable" content="yes" />
Then the answer is No, sadly. I just finished project that needed to work like that and the only way you can open links in new "tab" is to create your own tabs with HTML/CSS/JS and open those links inside iframes.
Also you need to be aware of X-Frame-Options: Deny that blocks websites to load inside iframe.
For example google, facebook... can't be opened inside an iframe anymore since they want to protect them self against Clickjacking.
At the end I end up making my app 100% javascript based and done everything on index.html page.
I also done some AJAX requests when I needed something from the server side...
And It works perfectly.
If you are using JQuery, see: handling downloads of exported material via ajax.