introduction - Dave's Blog

Search
My timeline on Mastodon

Tweet from David_Risney

2015 Mar 11, 9:57
Chrome moving Service Worker's fetch() API to the window. Like XHR but with promises http://updates.html5rocks.com/2015/03/introduction-to-fetch … via @ChromiumDev
PermalinkComments

Retweet of dakami

2015 Mar 4, 4:44
http://ratbagp.blogspot.com/2011/01/howard-strauss.html … Actual quotes re: the introduction of electricity at Princeton.
PermalinkComments

Subtleties of postMessage

2013 Jul 15, 1:00

In IE10 and other new browsers one may create MessageChannel objects that have two MessagePorts each connected (w3c spec calls it entangled) to one another such that postMessage on one port results in the message event firing on the other. You can pass an array of ports as the last parameter to postMessage and they show up in the ports property of the message event arg.

Origin

The postMessage here is like the worker postMessage and unlike the window and iframe postMessage in that it applies no origin checking:

  1. No origin postMessage in workers and MessagePorts: postMessage(messageData, ports)
  2. Origin postMessage in windows and iframes: postMessage(messageData, targetOrigin, ports)

Unfortunately the origin isn't an optional parameter at the end to make the two postMessages have the same signature.

On the event handler side, the event arg always has an origin property. But in the no origin case it is always the empty string.

Source

There is also a source property on the message event arg which if set is an object that has a postMessage property allowing you to post back to your caller. It is set for the origin case, however, in the no origin case this property is null. This is somewhat reasonable because in the case of MessagePort and Workers there are only two endpoints so you always know the source of a message implicitly. Unlike the origin case in which any iframe or window can be calling postMessage on any other iframe or window and the caller is unknown. So not unreasonable but it would be nice if the source property was always set for consistency.

MessageChannel start

When a MessageChannel is created it has two MessagePorts, but until those ports are started they will queue up any messages they receive. Once started they will dispatch all queued messages. Ports don't have to be started to send messages.

A port may be started in two ways, either by explicitly calling the start method on the port, or by setting the onmessage callback property on the port. However, adding an event listener via addEventListener("message", does not start the port. It works this way in IE and Chrome and the spec states this as well.

The justification is that since you can have only one callback via onmessage that once set you must implicitly be ready to receive messages and its fine to start the port. As opposed to the addEventListener in which case the user agent cannot start implicitly because it doesn't know how many event listeners will be added.  I found Hixie stating this justification in geoloc meeting notes.

Links

W3C Spec

Opera introduction

PermalinkCommentsDOM html javascript postMessage technical web-worker worker

Are you new to "Hadoop"? Settle in...

2009 Oct 8, 4:59A brief introduction to Hadoop, its history, subprojects, and current statusPermalinkCommentsvia:pskomoroch hadoop introduction google yahoo facebook database technical

Internet Archive: Free Download: Hypercard

2009 Sep 12, 3:57"An introduction to Apple's Hypercard... Originally broadcast in 1987."PermalinkCommentshistory apple hypercard mac computer programming video

FRONTLINE: poisoned waters: introduction | PBS

2009 Apr 29, 1:06More than three decades after the Clean Water Act, iconic American waterways like the Chesapeake Bay and Puget Sound are in perilous condition and facing new sources of contamination.PermalinkCommentstodo via:jen video pbs environment

GNSO Final Report Part A - August 2007

2008 Jul 22, 10:58"ICANN Generic Names Supporting Organisation - Final Report: Introduction of New Generic Top-Level Domains"PermalinkCommentsicann tld dns reference

Traditions of Magic, Introduction

2007 Oct 3, 11:29University of Michigan's collection 'Traditions of Magic'.PermalinkCommentsmagic history research michigan

Wikipedia Tools

2007 Sep 12, 6:54I'm visiting Wikipedia more and more recently but I always find myself reading the referenced webpages to get the full context of quotes and for more info. Basically I use Wikipedia as an introduction and a place to look for links. For times when I'm looking for opinions rather than facts I like to use Everything2. No need to check references there.

There's the much hyped WikiScanner tool which reports who has been making anonymous (thought to be anonymous at the time anyway) edits to Wikipedia. Its humorous and interesting in a few cases, but in general I think its stretching to say that because an IP address range is owned by a corporation and someone edited Wikipedia on an IP in that range that you can attribute that edit to that corporation. If I edited Wikipedia I'd probably do a bit of that during my lunch break, but that wouldn't mean that Microsoft wants the Wikipedia pages for Weird Al, Dave Risney, URIs, or whatever else I would edit on Wikipedia changed.

Also, via Everything Is Miscellaneous I found the tool Wiki Dashboard. Wiki Dashboard proxies Wikipedia and on each page shows a timeline view at the top with who made edits and when. Its nice to see a gentle curve down from an initial spike at the beginning for topics you don't imagine to be controversial. As the canonical test page for this service I looked up 'Elephant' the Wikipedia page Stephen Colbert suggested folks vandalize on his show on 2006 July 31st. If you look at the Wiki Dashboard Elephant page you can see a very large spike in edits on that date. That's all I need to see.

As a side note, for the link on Stephen Colbert suggesting folks vandalize Wikipedia I linked to a Wikipedia article. Is it inappropriate to provide info about Wikipedia being vandalized and thus incorrect via a link to a Wikipedia article?PermalinkCommentswikidashboard stephen-colbert wikality wikipedia wikiscanner colbert-report

Wireless Application Programming with J2ME and Bluetooth

2007 May 11, 12:38Sun's introduction to bluetooth.PermalinkCommentsbluetooth tutorial article development sun research:wii-remote

Canon SD800 IS Digital ELPH Review: 1. Introduction: Digital Photography Review

2007 Apr 18, 1:04I just purchased this camera.PermalinkCommentscamera photo review shopping photography canon sd800

Why Microformats - Introduction to Microformats

2006 Oct 30, 10:34PermalinkCommentsarticle web2.0 microformats semanticweb software standards reference internet web development mf

Introduction - VSA Scripting in .NET - Developer Fusion, the UK developer community - VB, ASP, C#, .NET, PHP and XML tutorials & source code

2006 Aug 17, 10:01PermalinkCommentsscript .net csharp javascript vbscript programming

Sed - An Introduction and Tutorial

2005 Dec 6, 11:50PermalinkCommentsdevelopment reference regex tools unix sed tutorial

TEI Gentle Intro

2005 Jul 15, 8:09A Gentle Introduction to SGMLPermalinkCommentssgml html xml w3c reference

Penny Arcade - We're here to help

2005 Mar 27, 5:54Introduction of the Bad Boys of PunctuationPermalinkCommentscomic penny-arcade punctuation humor
Older Entries Creative Commons License Some rights reserved.