I've been using the double-slashed, protocol-independent, version of URLs systematically whenever I can for a while now, in HTML (for href
on anchors and src
on images) and in JS (for XHR). Today I have been wondering if this would be possible on OpenGraph tags.
Currently I have this:
<meta property="og:image" content="http://static.example.com/image.png">
<meta property="og:url" content="http://example.com">
I have been wondering what the effect of using the following would be:
<meta property="og:image" content="//static.example.com/image.png">
<meta property="og:url" content="//example.com">
- Is this allowed by the spec?
- Is this allowed by (major) implementations?
- Are there any obvious issues I'm not seeing?
- Am I thinking about this completely wrong?
- Has anyone done this or tried this before?
Okay, that's a bit too many questions, but you can see where I'm going: should I (and other developers who might chance upon this) use explicit protocols or is it okay to leave them off for og:*
properties?