Save Bookmarks in Safari to Open in Stream Web
One month ago, MAZ released a browser called âStream Webâ for iOS. Unlike other iOS browsers, which are scaled down versions of desktop browsers, Stream Web is made specifically with mobile devices in mind. When we started to create the browser, we looked at the ones already out there and asked ourselves: why are their address bars and navigation placed at the top of the screen, where you have to reach for them? Why are there back and forward buttons on phones that are made as touch devices, with full gesture capabilities? And most importantly, why are we still copying and pasting ugly, long URLs to share what we like? The entire MAZ team was along for the journey every step of the way, discussing at length what we all utilized the most in the mobile browsers we were using, and what else we wished we had.
Itâs always a proud moment for all of us at MAZ to release something we really believe in. But, one thing we wish it had been possible to fix for everyone is the ability to change your default browser on iOS. Today, I will share a tip for iOS developers (not a developer? skip the code and read what's next) on how to provide a user with an option to open links from their app to Stream Web.
Use below methods to implement âOpen in Stream Webâ functionality:
(BOOL) isStreamWebInstalled
  return [[UIApplication sharedApplication] canOpenURL: [NSURL URLWithString:@"strmw://"]]͞
 //Use this method to open the URL as a new tab in Stream Web.
  (BOOL) openInStreamWeb:(NSURL *) url
    NSURL *swURL = [self webToStreamWeb:url]͞
      return [[UIApplication sharedApplication] openURL:swURL]͞
// Utility method to convert web url to Stream Web custom url.
  (NSURL *) webToStreamWeb:(NSURL *) url
    NSURL *swURL = nil͞
    if([url.scheme isEqualToString:@"http"])
      swURL = [NSURL URLWithString:[url.absoluteString
  stringByReplacingOccurrencesOfString:[url scheme] withString:@"strmw"]]͞
    else if([url.scheme isEqualToString:@"https"])
      swURL = [NSURL URLWithString:[url.absoluteString
stringByReplacingOccurrencesOfString:[url scheme] withString:@"strmws"]]Íž
Okay, so if that didnât make sense to you - here is a general tip for everyone to open web pages that youâre reading in Safari to Stream Web. Basically, you need to write a âBookmarkletâ, which is a normal bookmark with some Javascript code (donât worry). See below for the steps!
1. Open Safari and open any web pageÂ
2. Tap on Share icon at the bottom and choose bookmark
3. Change Bookmark title to âOpen In Stream Webâ Tap on "Save" to save bookmark
4. Tap on bookmark icon next to share icon
5. Tap on "Edit" at the Bottom right Tap on the âOpen In Stream Webâ, the bookmark you just made
6. Change the URL (e.g. http://streamapp.co/) to:
javascript:location.href='strmwâ+location.href.substring(4)Íž
Now you have the option to open Safari pages in Stream Web by tapping on the Bookmark icon and choosing âOpen In Stream Web.â For now, thatâs all - but there will be more cool tech stuff again soon! Until then, happy Stream browsing.
*If youâre an App developer, you can now have the Stream SDK in your App. Ping us for more info!
Manoj Karki is VP of Engineering in Noida, India. Follow him on Twitter @mskarki.













