Chrome App webview behavior on chrome extension - javascript

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.

Related

Way To Inject Javascript in PWA on Non-PWA Pages?

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

How does Zoom launch their desktop app from Google Chrome?

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.

How can I manage websites settings in electron

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)

Detect apple's forced phantom banner in JavaScript

I'm not an iOS developer, and know little less about Safari's configuration by apple.
But Please, hear me out.
I have universal links configured, and I understand that if the App is installed, visiting the website with Safari browser will automatically show a phantom banner to open the page in the app. This seems one of the policies apple included in their Universal Link settings.
Image below shows an example of the Phantom banner
My question is: How can I detect the presence of this Apple's Phantom banner through JavaScript?
To be precise, currently, there is no way to detect the Phantom banner if the universal link is enabled in safari.
You cannot remove it through JS also it has no presence in the DOM.
Try integrating a 3rd party plugin like Firebase or Branch.
I tried firebase hoping it can resolve the issue and below is a summary.
It will create a dynamic link to your webpage which is nothing but a wrapper on your deep link.
But with that you will lose the ability to click on your webpage link and open the App, instead, you will have to use the dynamic link to open the App.
The Dynamic link can be on your domain or on a custom domain.
Here is some more information on domain configuration
https://firebase.google.com/docs/dynamic-links/custom-domains
In my case, the ask was to link directly to the website link so this did not help much. But if the ask is to open the App on a link click then it can help as the Apple App Association file will not be on your domain and you will not see the phantom banner.

How do I check in Firefox and Chrome if a plugin is installed

I'm using an embedded plugin in my web app to enable scanning (Dynamsoft's webscanning plugin). I'm serving an xpi to firefox users and a crx to chrome users. When viewing the page without the plugin installed, Firefox will try to download the plugin and the user will need to click "manual install" to install it. Chrome will make no attempt to donwload the plugin (this is by design, according to http://code.google.com/p/chromium/issues/detail?id=15745)
I would like to use javascript to detect wether the plugin is installed or not (preferrably before trying to load it through the embed tag). If no plugin is installed, I want to provide an explanation and a link to the correct plugin to the user. Both browsers install their respective plugins without any problem if the user clicks at a download link instead of just trying to load through the embed tag.
So, does anybody know a way detect wether a plugin is installed using javascript?
Have you had a look at window.navigator.plugins?
..and the equivalent reference for webkit plugins-
The Apple reference for the WebKit DOM appears to have disappeared. navigator.plugins does work for me in Safari & Chrome. See a jsfiddle here: http://jsfiddle.net/2EaKD/
Sounds to me like a potential security hole, if a website (something remotely) could access your plug-ins (something locally). So I guess this is not possible.
Your addon can monitor which pages are opened by the user. If it is your page, you can make your addon set a global variable in that page and your page's JavaScript should be able to detect this.

Categories

Resources