Service Workers in iOS?!!!!111one

Someone has spotted a bug in WebKit’s Bugzilla with a patch for implementing Web IDL and stub for Service Workers.

The “PWA community” is 🔥 on fire 🔥 on Twitter right now.

I find this amusing, as I think it was only yesterday that I was reading Yet Another Rant in Medium by someone who had to learn React Native instead of just building a website, because iOS didn’t support Service Workers, also accusing Apple of not supporting the Web because it doesn’t make them any money directly. I don’t think that was the straw that broke the camel’s back, but it’s a funny coincidence.

I also don’t know where the rant is, as people share so many Medium “pieces” in twitter and I find it hard to differentiate between them. I also often just open in an incognito window out of habit so I can’t even find it in my history.

Anyway, I’m excited! It won’t be implemented next month (I reckon), and we’ll probably have to wait until the next big iOS roll out that ships a new Safari, but it is nice to see movement rather than a stern ‘under consideration’. In the future, you will not need to build two or more different versions of a native app, using different programming languages, in order to get offline support, push notifications, etc, etc. Yay!

I’m also secretly happy that WebKit use Bugzilla as well. There’s something about shared pain that fortifies the soul… 😂

Back to my recent past

This has to be my most eventful holiday journey yet. First, my suitcase’s lock decided it would not to open again even if I entered the proper combination, and I had to pull the zips open using a screwdriver when I arrived home. I still don’t know what happened, but I don’t think I’ll be using the built-in lock again, unless I plan on bringing a screwdriver with me at all the times too –maybe I could place it on one of the external pockets! At least I’m glad I didn’t have to destroy the lock and thus the suitcase doesn’t look vandalised, as I’m a firm believer in the broken window theory.
Continue reading “Back to my recent past”

Mental note on Safari, cookies and underscores

In short: do not use underscores for your local domains.

Apparently, Safari decided to be kind of very strict, which means it will show a website whose domain name contains underscores, but will dutifully ignore every request to set cookies on it.

It’s very funny because if they really wanted to be strict they should not show the website at all, instead of making me peek into odd pages trying to find out why oh why it worked on opera and firefox but not in Safari.

And it seems it also can lead to the same problem in IE, which makes me kind of agree with that lemma: Safari is the new IE!

Luckily underscores are not allowed when registering a domain (I just checked that). Otherwise we would have heard a ton of complaints from customers who ordered a website and then couldn’t login at their own website because the domain contained an underscore.

Extra bonus: you can use this snippet of code for checking that cookies are working. Save it as ‘cookie-test.php’ or something that you fancy and reload reload reload. It should show “X is 0”, “X is 1”, “X is 2”, etc.

If it doesn’t work, it’ll always show “X is 0”;

<?php

if(isset($_COOKIE['x']))
{
        $x = $_COOKIE['x'];
}
else
{
        $x = 0;
}

setcookie('x', $x+1);

echo "X is $x";

?>

Switching is good stuff

It had to happen. When you’re all day long working with php and mysql, smarty and whatnot, the last thing you want to do when you have some free time is to continue fighting with the same issues once and once again.

I also had been testing some wordpress installations and I finally surrendered to WordPress. Specially since version 2.0 is very neat and attractive and offered me some features I wanted but didn’t feel motivated to code by myself (pinging, trackbacking, rss for comments of one entry, etc). I did know how to do them but sincerely it is not the same that when I started doing php stuff, back to 2002. Then most of the things were new and kind of a challenge, like “will i be able to create my own system to keep a log of my stuff without having a design as ugly as slashdot’s one?”.

But now -and specially after having minimumly guessed the possibilities of other methodologies like Ruby On Rail’s one- it is highly discouraging to do more simple stuff in php. So I said to myself:

  1. do I want to keep reinventing the wheel forever and not adding new ideas or functionalities (i.e. continue with my self made blog), or
  2. do I prefer to use something which sums the efforts of lots of people, and contribute with whatever I can to the community? (i.e. switch to wordpress)

Obviously I chose 2) as you can see!

I have set up a redirection for the old rss, so it still should work perfectly. If you find something wrong please tell me 🙂

Also, I haven’t applied any hack at all to the css and html so it is all valid but some things do not work as they should in The Cancer (i.e. Internet Explorer), although they look gorgeous in Firefox (both Mac and Windows) and Safari (and I am not going to break my clean css & html in order to fix it). It’s been funny to play with selectors and all of those advanced css techniques I can’t use normally “because it needs to work with explorer”.

if06 and safari bugs

Some of you may know and others may not know, but I am not contributing directly in the organization of ifparty this year for several reasons. Even though I am providing certain assistance if it’s on my hands. For example, this week I have been submitting and providing info to Webkit’s developers to be able to fix the weird behaviour that Safari exhibits when trying to use ifparty’s new web.

I’ll explain what happens. This year’s site has been completely built by someone else. He changed the templating system with something he made, more simple and with which he was more comfortable. But with safari it’s impossible to go almost anywhere. With a pair of clicks, the page gets to a Safari error message and that’s all you can get:

Safari can’t open the page.
Too many redirects occurred trying to open “http://ifparty.scenesp.org/06/?section=register&language=ct?section=register?section=register?section=register?section=register?section=register?section=register?section=register?section=register?section=register?section=register?section=register?section=register?section=register?section=register?section=register?section=register?section=register”. This might occur if you open a page that is redirected to open another page which then is redirected to open the original page.

I thought this may have something to do with the way the pages were served, lots of redirections and more specially… relative url’s for the redirections. I read once that it was tecnically wrong. That was not an standard: http redirections have to use absolute full formed url’s. Although usually browsers just ignore this for allowing thousands of pages to continue working. So that’s why I thought the reason could be on that.

Anyway, not having time to try to fix the code of the page and just inspired by a post in Surfin’ Safari blog (which is highly interesting, by the way) I decided to submit the bug to the Webkit team.

In fact, there are two bugs there. One, the problem with relative urls just formed with ?parameters and flash appending the new value to the existing url, instead of replacing the appropiate parameters. That one is already fixed! They were very fast and I can’t do less than thank them for that efficiency. Here’s the bug page, just in case you feel curious: Query string always appended to Flash URLs, instead of being replaced. The other bug has something to do with the redirection limit exceeded error and I don’t have any clue of why does it happen, nor do have the guys from webkit. Seems like it’s something outside their bounds and they suggested me to report the bug to Apple. Let’s hope Apple engineers are as efficient as webkit ones and we will be able to browse ifparty’s website in Safari quite soon! 🙂

Meanwhile you can browse the site with Camino or Firefox from your mac (don’t even think about explorer, you know it sucks terribly, specially on mac, and even more with that old interface which looks like "You’ve Got Mail" interfaces), and don’t forget to register yourself in the party, as organizers are willing to prepare all but they need to know how many people is going to the party!