I have built a Chrome App which needs to load some websites inside its own window.
The purpose is to display full-screen contents on TVs using Google Chromeboxes in Kiosk mode.
I can't use iframes as the content I must load doesn't allow it.
My researches led me to some code like :
chrome.browserAction.onClicked.addListener(function(tab) {
chrome.tabs.create({'url': event.target.href})
})
This seems to open a new tab on the browser running the extension, but not in the extension window.
The vision I have about chrome apps may be confused as it's the first I'm developing, please don't hesitate to tell me the basics I would not have heard of
You need to use the <webview> tag, available in Chrome Apps, to embed external content.
This does not trigger anti-framing protection, since from the point of view of web security each <webview> is a top-level browsing context.
Note the limitations of <webview>: some web features like message boxes or permission requests have to be implemented by you.
As an example of webview usage, see the Browser sample app.
Related
I'm currently developing a web app that allows users to add a list of websites that they want to block i.e. preventing them from accessing the website from their browser.
Ideally I want to be able to block websites on every browser but this is difficult, so I narrowed my research to just Chrome for now. I came across the chrome.webRequest api which seems promising but it specifically says its for chrome extensions and am unsure if it would work for my web app.
Can anyone point me in the right direction for blocking websites on a web app, ideally using javascript. Any help is much appreciated!!
EDIT:
1) I forgot to mention that I'm using firebase for my backend.
2) People have been saying that I can't block websites outside the web apps scope, if I instead used electron to make the web app a desktop application would it then be possible?
Firstly you have a database containing URL of blocked websites. URLs are modified using your web app. That's one part. Now your problem is how to make the browser work with your database.
The only possible way for you to share blocked URLs with the browser is via API. You must have API that can communicate outside your web app.
Now browsers such as chrome/firefox give users the power to make changes inside and outside the dom. For chrome, you have chrome extension where Google provides API so the users can manipulate actions outsides regular actions such as manipulating dom. An example I can give that is closely related to your subject matter, which is an action activated before/after a user enters URL on the search box and for that, we use the following API from https://developer.chrome.com/extensions/webRequest
And it's same for Firefox.
I have a Web App and an associated Browser Extension and I need a way of communication information from the Web App to the Extension when an action occurs in the Web App.
Chrome has runtime.onMessageExternal() etc. which lets your app or extension receive and respond to messages from regular web pages. ref: https://developer.chrome.com/extensions/messaging
This should meet my needs, however it isn't available in Firefox and I need a cross browser solution.
Any suggestions?
You can do this with content script. Messaging from content script support by FF from version 50.
I'm looking for leads on how to capture web page metadata from the current browser page. I want to create a feature in my application that will allow the user to press a hot key and record meta data from the web page currently open in the user's browser. My application will be running minimized, this feature is to be activated by a global hot key.
I'm using nw.js (formerly Node-Webkit) to create this application, so ideally, the solution would be javascript running in a desktop installation of Node.js. If this is not practical, I understand that I can call platform specific code from nw.js, so solutions developed in any desktop os language would be of interest.
My application targets OS X and Windows.
I'm hoping to capture metadata from all major modern browsers (Chrome, Firefox, Safari and IE 10+).
At a minimum I need to capture the page url, but I also want to capture Keywords, Description and highlighted text for the source web page.
I need to implement this function without modifying the source webpage in any way, and I prefer to avoid the need for browser extensions, bookmarklets or plugins.
If a solution exists using a remote controlled browser extension (no user interaction) that would be of interest, but ideally I want to avoid requiring the end user to install or interact with anything but my application.
My search to date has located no information on reading web page information from applications outside the browser.
Any thoughts or leads are much appreciated.
I'm developing a small site that will only be viewed in-app inside a UIWebView, and one page has several links to an external website. I'd like these to open in mobile Safari, but all links inside the app load within the webview. Modifying the source of the app isn't an option since the site needs to be live before any changes could be submitted.
Is there a way to force a link inside a UIWebView to launch mobile Safari using HTML/5 or Javascript? Mimic shouldStartLoadWithRequest? Sneaky, hacky workarounds or brilliant alternate solutions?
(And, out of sheer curiosity... why not?)
It would be bad design to let sites access the frameworks on the iPhone via simple HTML. This would open up all sorts of security holes. Its not web behavior you want to alter, so I think you may need to change the app source. I still don't understand why that isn't an option. Could you go into more depth?
One option would be to add a custom URL handler. Your website could then determine if the "broswer" is the app and serve custom URLs for those links you'd like to maintain (aka open) in your app. Then, any standard HTTP/s URLs would open in Mobile Safari.
In other words, have your web server provide urls like myappurl:// for the links you'd like your app to handle, and http:// which would open Mobile Safari.
How to pop out a Firefox window without an address bar or status, basically what i need is a bar minimum window that renders my html.
As far as I know, it's possible in neither Firefox nor Internet Explorer any more for security reasons.
If you're building a web application, you could try Mozilla Prism:
Prism is a simple XULRunner based browser that hosts web applications without the normal web browser user interface. Prism is based on a concept called Site Specific Browsers (SSB). An SSB is an application with an embedded browser designed to work exclusively with a single web application. It doesn’t have the menus, toolbars and accoutrements of a normal web browser.
If you need to serve web pages to the public, it's not for you, though. It needs client-side installation.
You can do it like this:
<a href="#" onclick="window.parent.open( 'http://www.google.com',
'','toolbar=0,location=0,directories=0,status=0,menubar=0,' +
'scrollbars=yes,resizable=yes,width=400,height=300').focus();
return false;">
Open Window
</a>