Skip to content

Instantly share code, notes, and snippets.

@hotchpotch
Created Nov 10, 2009
Embed
What would you like to do?
require 'rubygems'
require 'json'
require 'open-uri'
data = JSON.parse open('http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/api/extension_api.json').read
res = []
data.each do |d|
n = d['namespace']
if d['properties']
res << d['properties'].map {|key, value| "chrome.#{n}.#{key}" }
end
if d['functions']
res << d['functions'].map {|key, value| "chrome.#{n}.#{key['name']}()" }
end
if d['events']
res << d['events'].map {|key, value| "chrome.#{n}.#{key['name']} # event " }
end
end
puts res.flatten.sort.join("\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment