Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 23 lines (19 sloc) 0.561 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
pageInfo =
  url: document.location.href
  title: document.title
  selection: window.getSelection().toString()
  isMap: false
  image: null

## Google Maps
if pageInfo.url.match /^http[s]?:\/\/maps\.google\./
  link = document.getElementById('link')
  if link and link.href
    pageInfo.url = link.href
    pageInfo.isMap = true

## Open Graph Protocol
og = {}
$('meta[property^="og:"]').each () ->
  og[ $(@).attr('property').match(/og:(.+)$/)[1] ] = $(@).attr 'content'

if og.image
  pageInfo.image = og.image

chrome.extension.connect().postMessage pageInfo
Something went wrong with that request. Please try again.