Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
New Standard Variables: Doh! #199
How have I not thought of adding these before:
Obviously, these will only work in non-protected (i.e. non-chrome) pages but this would be very useful I imagine. Especially when coupled with the new
This'll probably be best implemented by only fetching the HTML from the content script and deriving the rest on-demand.
I can't decide what the scope of html should be (i.e. the entire page source or just that of the
# content.coffee html: document.documentElement.outerHTML # background.coffee markdown: -> markdown = '' if @html container = document.createElement 'html' container.innerHTML = @html $container = $ container $body = $container.find 'body' markdown = md if $body.length then $body.html() else $container.html() markdown text: -> text = '' if @html container = document.createElement 'html' container.innerHTML = @html $container = $ container $body = $container.find 'body' text = if $body.length then $body.text() else $container.text() text