Skip to main content
 

Heads up webmasters -- please consider updating your javascript snippets.

1 min read

Heads up webmasters -- please consider updating your javascript snippets.

Originally shared by Ilya Grigorik

All Google+ widgets have been updated to use the script[async + defer] pattern! E.g. +1 button docs: http://bit.ly/YHoj96

What's the benefit? Loading widgets via script[async+defer] does not block the document parser (see [1]), and allows the preload scanner to discover the script resource and initiate an earlier fetch (see [2]). Net outcome, both your page and the widget load faster! Have a G+ widget on your page? Check out the docs for guidance on how to update your snippets.

Kudos to the G+ team for taking the lead on this! Hope to see more widget providers adopt the same pattern.

[1] https://developers.google.com/web/fundamentals/performance/critical-rendering-path/adding-interactiv...

[2] https://www.igvita.com/2014/05/20/script-injected-async-scripts-considered-harmful/

 

I hope you can update Mark with authorship changes the same way you treat Search Engine Land.

1 min read

I hope you can update Mark with authorship changes the same way you treat Search Engine Land....  He's going to lose some major credibility.

Originally shared by Mark Traphagen

Interview with Me About Google Authorship

Andre Alpar of OMReport.de interviewed me last June at SMX Advanced in Seattle about Google Authorship and the changes we had seen from the beginning of the year up to that point.

Please note that this interview was conducted before Google removed all author photos from regular search, but Authorship still works, and I believe the principles I discuss here are still valid.

 

John Hjelmstad / Jonathan Beri - same deal as sign in button...  let's incorporate it...

2 min read

John Hjelmstad / Jonathan Beri - same deal as sign in button...  let's incorporate it...

Originally shared by Gerwin Sturm

As you might have noticed I invested quite some time in Polymer recently. What I like about web components is that they make a lot of things a lot easier, except...

Normally adding a +1 button (or any other Google+ plugin) to a website is just about the easiest thing you can do.

1. Take the code snippet from the docs, e.g. https://developers.google.com/+/web/+1button/

2. Paste it in your code at the appropriate place.

3. Done.

Unfortunately the gapi JS library doesn't like to work with the Shadow DOM. Even if you pass in a direct reference to an element inside of your element it won't work.

The (https://github.com/GoogleWebComponents/google-hangout-button/) works around this issue by adding an element to the light DOM, telling gapi to render the button there, then snatching the element and sending it to the shadow realm dom.

Since there are a lot more widgets to choose from, I took this idea and started by creating a generic element that takes `type` and `data` as attributes to render the appropriate plugin, using the same idea as the hangout-button.

So for the default +1 button you could just use

Or for a profile badge you would use

From there I started to create specific elements, that have the relevant attributes for each plugin.

For now there are only two but others are easy to add:

(the profile attribute will be used to build the href attribute needed by the profile widget)

The plugins still aren't really happy inside of the shadow dom, displaying some errors in the console, and not all interaction seems to be working correctly.

I have some other ideas I will test to improve this, but maybe the gapi team will eventually support Shadow DOM properly ;)

For now these elements work better than not working at all :)

Source code: https://github.com/Scarygami/google-plugins

Docs: http://scarygami.github.io/google-plugins/components/google-plugins/

Demo: http://scarygami.github.io/google-plugins/components/google-plugins/demo.html

 

Read this behind the scenes article about Project Boswell with Brett Lider  and Joseph Smarr  who toiled long and...

1 min read

Read this behind the scenes article about Project Boswell with Brett Lider  and Joseph Smarr  who toiled long and hard to deliver an awesome feature.

This article also showcases how sometimes you have to throw away the first few concepts before you get it right.   Happy that I had a small part at the beginning of the project and props to the many folks that invested time and effort to get this out the door.

 

EA FIFA '73 spotted at Google...

1 min read

EA FIFA '73 spotted at Google...