Can you use a script on your page with the "bookmark us" url on a smartphone? I know Chrome doesn't support this function but i was wondering if there is a way to get it working on an iphone?
Cheers,
Toby
As far as I know, there is unfortunately no way to do this in code on iOS.
The suggested route is to prompt the user to add your website as a bookmark.
To do this, there is a neat little JS library: mobile-bookmark-bubble.
Related
To open a native app from Safari we are using a url scheme redirection like myapp://do/something.
I know at least two ways to achive this:
Inserting iframe with src attribute equal to desired url (works on iOS8 only, stopped working on iOS9)
Replacing window.location.href property with desired url (works for both iOS8 and iOS9)
The both ways work well for iOS8 and redirect a user immediately to the installed application without any confirmation dialog. But starting from iOS9 Safari began to show a confirmation dialog to make sure that a user really wants to open an app:
Code on the page from above screenshot is pretty simple:
<!DOCTYPE html>
<html>
<head></head>
<body>
<script>
window.location.href = 'fb://';
</script>
</body>
</html>
I found no any official description for this changes on apple's site. It seems to me that there is nothing we can do with this behaviour.
QUESTION: Is somebody already faced this problem? Any ideas how we can avoid this confirmation box in Safari?
The confirmation dialog was added to address known vulnerabilities in many apps with registered iOS URL Schemes. It prevents malicious web pages from invoking URL Schemes that cause apps to make transactions on the users behalf without their knowledge. I'm not aware of any way to disable it.
More details on the vulnerability can be found in this BSides Las Vegas presentation:
http://www.irongeek.com/i.php?page=videos/bsideslasvegas2014/pg10-ios-url-schemes-omg-guillaume-k-ross
I'm looking to develop a browser extension that would recognize links from news websites and display that articles' content in a popup screen upon a mouseover. The problem is, I have no idea where to start. I have past experience in HTML, CSS, and Javascript but in terms of browser extensions I'm a fish out of water. Could someone explain to me how one would go about starting something like this? Thanks!
You can create new extensions for Chrome this may be useful to you...
or refer this
I'm also an extension noob, but I know of a really good jQuery plugin for making the hover popups (tooltips).
http://jquerytools.github.io/documentation/tooltip/index.html
I'm working on an APP that consist of HTML and CSS using the Cordova framework.
There is a button that should open a webpage. The problem is that it opens the webpage inside of the app instead of safari.
My knowledge of Objective C is extremely limited (none) so I was hoping there would be a solution using maybe Javascript.
I've looked all over the internet but couldn't find a non-Objective C solution.
The button is pretty straightforward: <img src="img/button.jpg" alt="website">
I thought target="_blank" might do something for me but that (unsurprisingly) didn't work.
You can use inappbrowser plugin
http://cordova.apache.org/docs/en/3.3.0/cordova_inappbrowser_inappbrowser.md.html#InAppBrowser
Detect click on link using javascript or jquery and use this following code
window.open('http://www.google.com', '_system', 'location=yes');
I found the answer to my problem:
Opening all URL's with Cordova childbrowser
Only problem is that it automatically opens twitter.com because of the share button for some unknown reason. I'm guessing this is because of an api call it's performing upon being loaded.
I was looking into making Firefox addons, and I need some help.
Is it possible to edit an HTML page that is open in the browser with javascript?
For example:
User types in "google.com"
Addon is activated
Javascript changes contents of "google.com" to maybe say "Hello!" at the bottom.
Of course this isn't specifically what I want to do, but a push in the right direction on how to accomplish such a task would be great.
~Carpetfizz
From within a Firefox addon this is obviously possible as many extensions do this.
If you, however, simply want to modify the DOM and nothing else than I would recommend taking a look at greasemonkey. Loads of example scripts around to do this: http://userscripts.org/
And the added benefit, if written correctly they also work in Chrome and other browsers.
Yes, it is. You must find a tutorial about javascript DOM manipulation
I have tried using JavaScript "AddFavorite" function in my code, but it does not work in Safari. It works in IE, I think I remember Firefox, but nothing I have tried seems to work in Safari. All I want to do is have a link on my website that people can click on and it automatically creates a bookmark in their bookmarks folder/bookmark bar.
Does this entail Applescript or something like it? Or a deeper programming language I am unaware of?
<a href="javascript:bookmarksite('Name', 'website.com')">
From the apple forums: forum-link
On the Mac side at least, Safari does not allow a website to add a
bookmark. I'm pretty sure the same behaviour is in the Windows version
as well.
I've been down this road, and what I discovered was that Safari does NOT allow bookmarks to be made with JavaScript:
Apple Forum
bytes forum
They consider it unsafe. As frustrating as this is, I get their point.
Unfortunately, most things like this tend to be browser-specific, and picky.
my JS is about level 0, but i did find this on an old article here:
One specifically for Chrome:
Add to favourites link for Google Chrome
And another on a cross-browser bookmark link:
Cross-browser bookmark/add to favorites javascript
Hope between the previous comment and these links, you get what you needed.
Chrome and Safari does not allow it for clear security reason.
You could usee a script like this:
http://www.dynamicsitesolutions.com/javascript/add-bookmark-script/
which handles many browser and has a nice fallback: show a browser customized alert with instructuion message.
Es: in chrome it says: "Ctrl+D to add as bookmark"
In IE something similar to the following would work: (MSDN)
window.external.AddFavorite(location.href, document.title);
However, this won't work in other browsers. In Firefox, I believe you can use
window.sidebar.addPanel(document.title, location.href, '');
to create a sidebar panel (not a real bookmark) but as far as I know Chrome and Safari do not allow Javascript to automatically create bookmarks. For those, I recommend giving the user the instructions to do it manually:
drag a link to their bookmarks
pressing Ctrl + D to add a bookmark
Clicking + or star icon in the toolbar