<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/rss-style.xsl" type="text/xsl"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	     xmlns:dc="http://purl.org/dc/elements/1.1/"
	   xmlns:atom="http://www.w3.org/2005/Atom"
	     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	  xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>chrome &#8211; Terence Eden’s Blog</title>
	<atom:link href="https://shkspr.mobi/blog/tag/chrome/feed/" rel="self" type="application/rss+xml" />
	<link>https://shkspr.mobi/blog</link>
	<description>Regular nonsense about tech and its effects 🙃</description>
	<lastBuildDate>Mon, 23 Jun 2025 09:03:34 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://shkspr.mobi/blog/wp-content/uploads/2023/07/cropped-avatar-32x32.jpeg</url>
	<title>chrome &#8211; Terence Eden’s Blog</title>
	<link>https://shkspr.mobi/blog</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title><![CDATA[An annoying SVG animation bug in Chrome]]></title>
		<link>https://shkspr.mobi/blog/2025/06/an-annoying-svg-animation-bug-in-chrome/</link>
					<comments>https://shkspr.mobi/blog/2025/06/an-annoying-svg-animation-bug-in-chrome/#respond</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Mon, 23 Jun 2025 11:34:12 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[chromium]]></category>
		<category><![CDATA[svg]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=61537</guid>

					<description><![CDATA[Writing web standards is hard. You have to write a formal specification which is useful for machines, humans, and web developers.  I recently stumbled across what I think is a little bug which might be caused by a misreading of the SVG Animation specification.  Here you should see two overlapping circles gradually appear:                                                  If you&#039;re on Chrome, you…]]></description>
										<content:encoded><![CDATA[<p>Writing web standards is hard<sup id="fnref:experience"><a href="https://shkspr.mobi/blog/2025/06/an-annoying-svg-animation-bug-in-chrome/#fn:experience" class="footnote-ref" title="I do have some experience in this matter." role="doc-noteref">0</a></sup>. You have to write a formal specification which is useful for machines, humans, and web developers<sup id="fnref:webdev"><a href="https://shkspr.mobi/blog/2025/06/an-annoying-svg-animation-bug-in-chrome/#fn:webdev" class="footnote-ref" title="Back in 2006, Catharine A. MacKinnon provokatively asked &quot;Are Women Human?&quot;. Her argument (which I shall badly summarise) is that if women were human, then they'd be protected by universal human…" role="doc-noteref">1</a></sup>.</p>

<p>I recently stumbled across what I think is a little bug which <em>might</em> be caused by a misreading of <a href="https://svgwg.org/specs/animations/#KeyTimesAttribute">the SVG Animation specification</a>.  Here you should see two overlapping circles gradually appear:</p>

<svg width="170" height="170" xmlns="http://www.w3.org/2000/svg">
    <path fill="#2c4169" d="M170 0H0v170h170z"></path>
    <circle r="45" cx="50" cy="50" fill="#e4da2e" opacity="0">
        <animate attributeName="opacity" begin="0s" dur="30s" values="0;  1;" keyTimes="0;  1" fill="freeze"></animate>
    </circle>
    <circle r="45" cx="80" cy="80" fill="red" opacity="0">
        <animate attributeName="opacity" begin="0s" dur="30s" values="0;  1;" keyTimes="0;  1;" fill="freeze"></animate>
      </circle>
</svg>

<p>If you're on Chrome, you might only see one circle animate. Why? Bloody semicolons! The bane of every programmer's existence<sup id="fnref:eng"><a href="https://shkspr.mobi/blog/2025/06/an-annoying-svg-animation-bug-in-chrome/#fn:eng" class="footnote-ref" title="I imagine English literature students also find them confusing; everyone does." role="doc-noteref">2</a></sup>.</p>

<p>The <a href="https://svgwg.org/specs/animations/#KeyTimesAttribute">specification for SVG Animation</a> has this text for human readers:</p>

<blockquote><p><strong>keyTimes</strong></p>

<p>A semicolon-separated list of time values used to control the pacing of the animation. Each time in the list corresponds to a value in the ‘values’ attribute list, and defines when the value is used in the animation function.</p>

<p>[…]</p>

<p>If the last semicolon separator is followed by either just white space or no more characters, ignore both the separator and the trailing white space.</p></blockquote>

<p>To me, that isn't ambiguous. The text <code>keyTimes="0; 1;"</code> has a final semicolon with nothing after it. Therefore it should be ignored. Instead, Chrome throws an hissyfit and says <code>Error: &lt;animate&gt; attribute keyTimes: Invalid value, "0; 1;".</code></p>

<p>But maybe the humans who wrote the description were sloppy. There's also a machine-readable formal specification. It defines the acceptable sequence as being:</p>

<p><code>&lt;number&gt; [; &lt;number&gt;]* ;?</code></p>

<p>This isn't quite Backus–Naur form<sup id="fnref:bnf"><a href="https://shkspr.mobi/blog/2025/06/an-annoying-svg-animation-bug-in-chrome/#fn:bnf" class="footnote-ref" title="Also the bane of programmers everywhere!" role="doc-noteref">3</a></sup>, but rather <a href="https://www.w3.org/TR/css-values/#value-defs">CSS Values</a>.</p>

<ul>
<li>The <code>&lt;number&gt;</code> is a <a href="https://www.w3.org/TR/css-values/#component-types">component</a>.</li>
<li>The <code>[</code> and <code>]</code> are <a href="https://www.w3.org/TR/css-values/#component-combinators">grouping combinators</a>.</li>
<li>The <code>*</code> and <code>?</code> are <a href="https://www.w3.org/TR/css-values/#component-multipliers">component multipliers</a>

<ul>
<li><code>*</code> "indicates that the preceding type, word, or group occurs zero or more times."</li>
<li><code>?</code> "indicates that the preceding type, word, or group is optional (occurs zero or one times)."</li>
</ul></li>
<li>The <code>;</code> is just a semicolon<sup id="fnref:cig"><a href="https://shkspr.mobi/blog/2025/06/an-annoying-svg-animation-bug-in-chrome/#fn:cig" class="footnote-ref" title="Just like how sometimes a cigar is just a cigar." role="doc-noteref">4</a></sup>.</li>
</ul>

<p>Reading the definition tells us that a valid value will be a number, followed by zero-or-more groups of "semicolon and another number" with an optional final semicolon.</p>

<p>So, based on my reading, I think Chrome is wrong to throw an error here. Both Firefox and Safari work with a trailing semicolon.</p>

<p>Accordingly, I've <a href="https://issues.chromium.org/issues/427020732">raised a bug with the Chromium team</a>.  If you think I have erred in this matter, please let me know.</p>

<div id="footnotes" role="doc-endnotes">
<hr>
<ol start="0">

<li id="fn:experience">
<p>I do have <a href="https://www.w3.org/TR/2018/WD-html53-20180426/">some experience in this matter</a>.&nbsp;<a href="https://shkspr.mobi/blog/2025/06/an-annoying-svg-animation-bug-in-chrome/#fnref:experience" class="footnote-backref" role="doc-backlink">↩︎</a></p>
</li>

<li id="fn:webdev">
<p>Back in 2006, Catharine A. MacKinnon provokatively asked "<a href="https://doi.org/10.2307/j.ctvjnrvck">Are Women Human?</a>". Her argument (which I shall badly summarise) is that if women <em>were</em> human, then they'd be protected by universal human rights. Given the state of the world then (and now) it is hard to argue that women receive as great a level of attention as the <a href="https://www.the-tls.com/politics-society/rights-equality/default-male">default male</a>. I don't intend to trivialise MacKinnon's work - but I do find it interesting that developers are often treated separately from other humans.&nbsp;<a href="https://shkspr.mobi/blog/2025/06/an-annoying-svg-animation-bug-in-chrome/#fnref:webdev" class="footnote-backref" role="doc-backlink">↩︎</a></p>
</li>

<li id="fn:eng">
<p>I imagine English literature students also find them confusing; everyone does.&nbsp;<a href="https://shkspr.mobi/blog/2025/06/an-annoying-svg-animation-bug-in-chrome/#fnref:eng" class="footnote-backref" role="doc-backlink">↩︎</a></p>
</li>

<li id="fn:bnf">
<p>Also the bane of programmers everywhere!&nbsp;<a href="https://shkspr.mobi/blog/2025/06/an-annoying-svg-animation-bug-in-chrome/#fnref:bnf" class="footnote-backref" role="doc-backlink">↩︎</a></p>
</li>

<li id="fn:cig">
<p>Just like how <a href="https://quoteinvestigator.com/2011/08/12/just-a-cigar/">sometimes a cigar is just a cigar</a>.&nbsp;<a href="https://shkspr.mobi/blog/2025/06/an-annoying-svg-animation-bug-in-chrome/#fnref:cig" class="footnote-backref" role="doc-backlink">↩︎</a></p>
</li>

</ol>
</div>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=61537&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2025/06/an-annoying-svg-animation-bug-in-chrome/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[What's the window size of a background tab?]]></title>
		<link>https://shkspr.mobi/blog/2021/09/whats-the-window-size-of-a-background-tab/</link>
					<comments>https://shkspr.mobi/blog/2021/09/whats-the-window-size-of-a-background-tab/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Sat, 04 Sep 2021 11:06:12 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[javascript]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=40166</guid>

					<description><![CDATA[Whenever I open Twitter in a new tab on my phone, the page layout looks weird for a few seconds. It starts out looking like the desktop view and then, after a few seconds, it  snaps back to the mobile view.  What&#039;s causing this?  Try opening this link to a window size detector in a background tab. Then visit that tab.  On Chrome, this is what I see.    If I hit the refresh button on that tab, the …]]></description>
										<content:encoded><![CDATA[<p>Whenever I open Twitter in a new tab on my phone, the page layout looks weird for a few seconds. It starts out looking like the desktop view and then, after a few seconds, it  snaps back to the mobile view.</p>

<p>What's causing this?</p>

<p>Try opening <a href="https://www.rapidtables.com/web/tools/window-size.html">this link to a window size detector</a> in a background tab. Then visit that tab.</p>

<p>On Chrome, this is what I see.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2021/09/zero-size.png" alt="The Outer window size is zero by zero." width="400" class="aligncenter size-full wp-image-40169">

<p>If I hit the refresh button on that tab, the  Outer window size snaps back:</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2021/09/full-size.png" alt="The Outer window size is 1413 by 768." width="400" class="aligncenter size-full wp-image-40168">

<p>What's going on?</p>

<p>According to the specification:</p>

<blockquote><p><a href="https://drafts.csswg.org/cssom-view/#dom-window-outerwidth">The <code>outerWidth</code> attribute must return the width of the client window. If there is no client window this attribute must return zero.</a></p></blockquote>

<p>This is where I get confused.  The <em>inner</em> width &amp; height are the amount of space the the browser has to display web content - so ignores the browser bar, menu bars, window decorations etc. The <em>outer</em> width &amp; height are the total amount of space the browser window has.</p>

<p>How can a browser window have no outer size, but simultaneously have an inner size???!?!</p>

<video class="aligncenter" id="video-40166-1" loop="1" autoplay="1" preload="metadata" muted="" width="268" height="250">
   <source type="video/mp4" src="https://shkspr.mobi/blog/wp-content/uploads/2021/09/bigger-on-the-inside.mp4?_=1">
</video>

<p>There <em>is</em> a client window. The tab may be rendering away in the background - but its parent still has a non-zero size.</p>

<p>There has been a <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=719296">bug report open on Chrome about this since <strong>2017</strong></a>.</p>

<p>Firefox takes a different approach. On desktop, both outer and inner are reported correctly for background tabs. On mobile, both outer and inner dimensions are set to zero.  This may change as it is a <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1579584">potential fingerprinting target</a>.</p>

<p>So, web developers, please don't rely on <code>window.innerHeight</code> and <code>window.outerHeight</code> - users may be opening your site in the background, which causes the browser to lie to you.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=40166&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2021/09/whats-the-window-size-of-a-background-tab/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[RTL Bugs]]></title>
		<link>https://shkspr.mobi/blog/2014/02/rtl-bugs/</link>
					<comments>https://shkspr.mobi/blog/2014/02/rtl-bugs/#respond</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Mon, 24 Feb 2014 12:02:16 +0000</pubDate>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[chromium]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[unicode]]></category>
		<guid isPermaLink="false">http://shkspr.mobi/blog/?p=9988</guid>

					<description><![CDATA[Take a look at the following text, looks normal enough doesn&#039;t it?  &#34;Harry ‮&#34;.draziw a si ‭Potter  Now, try to select the text and see what happens.  WHAT WITCHCRAFT IS THIS?!  If you examine the source code for this page, you&#039;ll see that I&#039;m using the Unicode Bi-Directional characters.  &#34;Harry &#38;#x202e;&#34;.draziw a si &#38;#8237;Potter  These characters are useful when writing text that includes, say, E…]]></description>
										<content:encoded><![CDATA[<p>Take a look at the following text, looks normal enough doesn't it?</p>

<h2 id="harry-draziw-a-si-potter"><a href="https://shkspr.mobi/blog/2014/02/rtl-bugs/#harry-draziw-a-si-potter">"Harry ‮".draziw a si ‭Potter</a></h2>

<p>Now, try to select the text and see what happens.</p>

<p>WHAT WITCHCRAFT IS THIS?!</p>

<p>If you examine the source code for this page, you'll see that I'm using the <a href="https://en.wikipedia.org/wiki/Unicode_character_property#Bidirectional_writing">Unicode Bi-Directional characters</a>.</p>

<pre>"Harry &amp;#x202e;".draziw a si &amp;#8237;Potter</pre>

<p>These characters are useful when writing text that includes, say, English and Arabic - but <a href="http://krebsonsecurity.com/2011/09/right-to-left-override-aids-email-attacks/">they can also be used for malicious purposes</a>.</p>

<p>On a more mundane level, they can cause all sorts of UI bugs.  I've just <a href="http://code.google.com/p/chromium/issues/detail?id=345691">filed a bug against the Chrome browser for how it handles these characters</a>.</p>

<p>If you right click on text with mixed direction, you'll notice that the UI behaves oddly.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2014/02/Chrome-RTL-fs8.png" alt="Chrome RTL-fs8" width="480" height="330" class="aligncenter size-full wp-image-9996">

<p>In Firefox, the behaviour is correct - although one could argue whether "Potter" ought to be reversed.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2014/02/Firefox-RTL-fs8.png" alt="Firefox RTL-fs8" width="480" height="430" class="aligncenter size-full wp-image-9995">

<h2 id="searching"><a href="https://shkspr.mobi/blog/2014/02/rtl-bugs/#searching">Searching</a></h2>

<p>So, what happens when we run these searches?</p>

<p><img src="https://shkspr.mobi/blog/wp-content/uploads/2014/02/Chromium-RTL-Search-fs8.png" alt="Chromium RTL Search-fs8" width="640" height="165" class="aligncenter size-full wp-image-9999"><br>
<img src="https://shkspr.mobi/blog/wp-content/uploads/2014/02/Firefox-RTL-Search-fs8.png" alt="Firefox RTL Search-fs8" width="640" height="165" class="aligncenter size-full wp-image-9998"></p>

<p>Neither Firefox nor Chrome do particularly well.  I'm not sure if the reversed text in the window title and URL bar are bugs in Ubuntu - or whether it's the fault of the app itself.</p>

<p>On Windows and Mac, we see this happen:</p>

<p><img src="https://shkspr.mobi/blog/wp-content/uploads/2014/02/Safari-RTL-fs8.png" alt="Safari RTL-fs8" width="818" height="155" class="aligncenter size-full wp-image-10002"><br>
<img src="https://shkspr.mobi/blog/wp-content/uploads/2014/02/IE-RTL-fs8.png" alt="IE RTL-fs8" width="606" height="145" class="aligncenter size-full wp-image-10003"></p>

<p>This would suggest that Google isn't correcting the direction of the text and that is deforming its own title tags.</p>

<h2 id="are-these-bugs"><a href="https://shkspr.mobi/blog/2014/02/rtl-bugs/#are-these-bugs">Are These Bugs?</a></h2>

<p>Ok, so having the title reversed isn't the worst problem in the world.  But do these examples count as bugs and, if so, who is responsible for them?</p>

<p>Every search engine I tried passed through the right-to-left-over-ride unscathed - so that's the fault of the search engine, right?  How the hell do you a report a bug to Google?</p>

<p>The title bar could either be a problem with the browser - <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=814030">Firefox has a bug report over a year old on the issue</a> - or the problem could be with the underlying operating system.  How would one find out?</p>

<h2 id="thanks"><a href="https://shkspr.mobi/blog/2014/02/rtl-bugs/#thanks">Thanks</a></h2>

<p>Thanks to <a href="https://www.linkedin.com/in/yuanphoon/">Yuan Phoon</a> for asking the questions which prompted this discovery.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=9988&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2014/02/rtl-bugs/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Malicious Use of the HTML5 Vibrate API]]></title>
		<link>https://shkspr.mobi/blog/2014/01/malicious-use-of-the-html5-vibrate-api/</link>
					<comments>https://shkspr.mobi/blog/2014/01/malicious-use-of-the-html5-vibrate-api/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Fri, 10 Jan 2014 11:49:08 +0000</pubDate>
				<category><![CDATA[mobile]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[opera]]></category>
		<category><![CDATA[scam]]></category>
		<category><![CDATA[vibrate]]></category>
		<guid isPermaLink="false">http://shkspr.mobi/blog/?p=9496</guid>

					<description><![CDATA[There is a new API in town!  HTML5 will (soon) let you make the user&#039;s device vibrate.  What fun!  Obviously, it&#039;s useful for triggering alerts, improved immersivness during gameplay, and all sorts of other fun things like sending Morse Code messages via vibration.  At the moment, Chrome (and other Android browsers) ask for permission before accessing features such as geo-location, camera,…]]></description>
										<content:encoded><![CDATA[<p>There is a new API in town!  HTML5 will (soon) let you make the user's device vibrate.  What fun!  Obviously, it's useful for triggering alerts, improved immersivness during gameplay, and all sorts of other fun things like <a href="http://www.smartjava.org/content/html5-remotely-vibrate-phone-morse-code-using-web-sockets-and-vibrate-api">sending Morse Code messages via vibration</a>.</p>

<p>At the moment, Chrome (and other Android browsers) ask for permission before accessing features such as geo-location, camera, address book etc.  This is a security measure to prevent your private information leaving your hands without your knowledge.</p>

<p>At the moment, <a href="http://shapeshed.com/html5-vibrate-api/">accessing the HTML5 Vibrate API</a> doesn't trigger an on-screen warning. Its use is seen as pretty innocuous.  Because, realistically, the worst it can do is prematurely drain your battery. Right?</p>

<p>I'm not so sure.</p>

<h2 id="evil-thoughts"><a href="https://shkspr.mobi/blog/2014/01/malicious-use-of-the-html5-vibrate-api/#evil-thoughts">Evil Thoughts</a></h2>

<p>We've all seen those scummy adverts designed to look like Windows pop-ups.  They usually pose as a legitimate system request - "Update Java" or similar.</p>

<p>Suppose a malicious web page pops up a fake system notification and vibrates at the same time. How confident would you be of telling the difference between a legitimate pop-up and a .png on the web page you're viewing.  After all, the phone buzzed - so it <em>must</em> be genuine.</p>

<p><img src="https://shkspr.mobi/blog/wp-content/uploads/2014/01/Fake-Airdrop.jpg" alt="Fake Airdrop" width="319" height="651" class="aligncenter size-full wp-image-9499">
Are you really receiving an "AirDrop" - or is this page trying to trick you?</p>

<p>Autoplaying sound on adverts in annoying - auto-vibration could be just as irritating.  Imagine searching through tabs until you found the single advert which was pulsing away trying to get you to buy new insurance.</p>

<p>For now, the <strong>intensity</strong> of the vibration cannot be controlled - only the duration.  It is not impossible to conceive of malicious code being able to exploit an unpatched browser flaw and overdrive the motor to destruction.</p>

<h3 id="faking-telephone-calls"><a href="https://shkspr.mobi/blog/2014/01/malicious-use-of-the-html5-vibrate-api/#faking-telephone-calls">Faking Telephone Calls</a></h3>

<p>When combined with HTML5 Audio, it would be possible to create a fairly realistic "Incoming Call" screen which vibrated and played a ringtone.  Once "answered", the page could play some audio which says "Hi, can you call me back urgently - my number is [premium rate line]" and then, perhaps, automatically open up the dialer using the tel: URI.
<a href="https://shkspr.mobi/vibratescam/"><img src="https://shkspr.mobi/blog/wp-content/uploads/2014/01/Phone-call-in-browser-scam-fs8-175x300.png" alt="Phone call in browser scam" width="175" height="300" class="aligncenter size-medium wp-image-9504"></a>
Could you tell if the above was a real phone call? If you looked closely, probably, but when the browser is playing your phone's default ringtone and the handset is vibrating, it would be pretty easy to be confused.  Combine it with a WebRTC call and you're looking at a <em>very</em> convincing scam.</p>

<h2 id="video-demo"><a href="https://shkspr.mobi/blog/2014/01/malicious-use-of-the-html5-vibrate-api/#video-demo">Video Demo</a></h2>

<iframe width="360" height="640" src="//www.youtube.com/embed/VqsRya3ZNoE?feature=player_embedded" frameborder="1" allowfullscreen=""></iframe>

<h2 id="source-code"><a href="https://shkspr.mobi/blog/2014/01/malicious-use-of-the-html5-vibrate-api/#source-code">Source Code</a></h2>

<p>Here's a basic example which you can try on your own phone - <a href="https://shkspr.mobi/vibratescam/">demo site</a>.</p>

<pre><code>&lt;body&gt;
   &lt;script type="text/javascript"&gt;
      navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate;
      navigator.vibrate([1000, 500, 1000, 500, 1000, 500, 1000, 500, 1000, 500, 1000, 500, 1000, 500]);
   &lt;/script&gt;
   &lt;img width="100%" src="phone.png" onclick="window.location.href='tel:09098790815';" /&gt;
   &lt;audio autoplay="autoplay"&gt;
      &lt;source src="ring.mp3" /&gt;
   &lt;/audio&gt;
&lt;/body&gt;
</code></pre>

<p>At the moment, the auto-vibrate and auto-ring only work on Firefox for Android. But no doubt other browsers will follow suite soon.</p>

<h2 id="warnings"><a href="https://shkspr.mobi/blog/2014/01/malicious-use-of-the-html5-vibrate-api/#warnings">Warnings</a></h2>

<p>Firefox was the only browser I found which supported Vibrate - on Android, neither Samsung's browser, Chrome, or Opera did - iPhone also doesn't yet support it.  No one cares about Windows Phone or BlackBerry - so I didn't test them*.</p>

<p>Firefox <strong>doesn't</strong> currently ask for permission when a <a href="http://davidwalsh.name/demo/vibrate.php">page requests access to vibrate</a>.</p>

<p>Do you think browsers should warn before a page vibrates - or is the risk too low?  I guess we'll have to see if the scammers take advantage of it - and whether there is a user backlash.</p>

<p><ins datetime="2014-01-11T14:57:24+00:00">*Update</ins>: thanks to the <a href="http://www.reddit.com/r/programming/comments/1uvlwt/malicious_use_of_the_html5_vibrate_api/">comments on Reddit</a> and on <a href="https://news.ycombinator.com/item?id=7036181">HackerNews</a> it would appear that BB10 <em>does</em> support the vibrate API, Windows Phone doesn't.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=9496&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2014/01/malicious-use-of-the-html5-vibrate-api/feed/</wfw:commentRss>
			<slash:comments>43</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Chrome For Android Font Rendering Bug]]></title>
		<link>https://shkspr.mobi/blog/2013/03/chrome-for-android-rendering-bug/</link>
					<comments>https://shkspr.mobi/blog/2013/03/chrome-for-android-rendering-bug/#respond</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Fri, 01 Mar 2013 12:00:47 +0000</pubDate>
				<category><![CDATA[mobile]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[font]]></category>
		<guid isPermaLink="false">http://shkspr.mobi/blog/?p=7697</guid>

					<description><![CDATA[The latest version of the Chrome Browser for Android has introduced a curious rendering bug.  When scrolling, I notice that the font hinting seems to break down.  This makes the text very &#34;juddery&#34;.  It looks like the fonts shrink and grow and they scroll. This is very disorienting when reading.  In this example I&#039;ve noticed that once I&#039;ve stopped scrolled the page, the fonts are hinted…]]></description>
										<content:encoded><![CDATA[<p>The latest version of the <a href="https://play.google.com/store/apps/details?id=com.android.chrome">Chrome Browser for Android</a> has introduced a curious rendering bug.</p>

<p>When scrolling, I notice that the font hinting seems to break down.  This makes the text very "juddery".  It looks like the fonts shrink and grow and they scroll. This is very disorienting when reading.</p>

<p>In this example I've noticed that once I've stopped scrolled the page, the fonts are hinted differently.</p>

<p><img src="https://shkspr.mobi/blog/wp-content/uploads/2013/02/1.png" alt="1" width="132" height="23" class="aligncenter size-full wp-image-7698">
<img src="https://shkspr.mobi/blog/wp-content/uploads/2013/02/2.png" alt="2" width="132" height="22" class="aligncenter size-full wp-image-7700">
<img src="https://shkspr.mobi/blog/wp-content/uploads/2013/02/3.png" alt="3" width="132" height="23" class="aligncenter size-full wp-image-7702"></p>

<p>I've enlarged the examples (without interpolation) so you can see them a bit more clearly.
<img src="https://shkspr.mobi/blog/wp-content/uploads/2013/02/1-Big.png" alt="1 Big" width="528" height="92" class="aligncenter size-full wp-image-7699">
<img src="https://shkspr.mobi/blog/wp-content/uploads/2013/02/2-Big.png" alt="2 Big" width="528" height="88" class="aligncenter size-full wp-image-7701">
<img src="https://shkspr.mobi/blog/wp-content/uploads/2013/02/3-Big.png" alt="3 Big" width="528" height="92" class="aligncenter size-full wp-image-7703"></p>

<p>To give you a good idea of what's happening, I've magnified the letter "e" (again, without interpolation).  You can quite clearly see what happens to the font.
<img src="https://shkspr.mobi/blog/wp-content/uploads/2013/02/e.gif" alt="e" width="300" height="340" class="aligncenter size-full wp-image-7704"></p>

<p>I can understand why the font hinting changes as the scrolling occurs - but why does it change even after scrolling has finished?</p>

<p>All screenshots taken on an N7100 running 4.1.2 with the latest version of Chrome for Android.  The Galaxy Note II has a fairly standard resoltion of 1280×720, giving it 267 PPI - that shouldn't cause any problems.</p>

<p><a href="https://code.google.com/p/chromium/issues/detail?id=174699">This issue has been reported to the Chromium team</a>.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=7697&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2013/03/chrome-for-android-rendering-bug/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
