dergachev / chrome-xpath-link

8 stars 5 forks source link

Create a bookmarklet to replace chrome-xpath-link #2

Open dergachev opened 11 years ago

dergachev commented 11 years ago

There's nothing except right-click-menu that's chrome specific, I think. So a user script (for greasemonkey) might work.

But I'd prefer the simplicity of a bookmarklet, since we don't actually want the script to run all the time on every web page.

The bookmarklet could then highlight all elements with IDs, so the user can pick one with the shortest URL.

For visiting the URLs you'd need a different bookmark, or perhaps running the same bookmark on a page with a XPATH URL fragment would scroll to it (dunno).

dergachev commented 11 years ago

Found a bookmarklet that does something similar:

Demo: http://zilliox.me/project/bookmarklet/ (myAnchor) Source: http://zilliox.me/project/bookmarklet/

Not great because it doesn't show what the anchor options are, but maybe worth looking at.

Related question: should the preview show just positions (you will scroll down to this spot), or whole divs (this div will be highlighted?)

dergachev commented 11 years ago

Some bookmarklet maker tools I found: http://benalman.com/code/test/jquery-run-code-bookmarklet/ http://benalman.com/projects/run-jquery-code-bookmarklet/ http://closure-compiler.appspot.com/home

https://github.com/johtso/CoffeeMarklet http://johtso.github.com/CoffeeMarklet/

http://ted.mielczarek.org/code/mozilla/bookmarklet.html http://ted.mielczarek.org/code/mozilla/ (I like his publishing style, eg "Extension ideas")

Also here's an interesting pintrest-style-gallery bookmarklet to inspire me: https://github.com/bregenspan/imagebookmarklet

dergachev commented 11 years ago

I'm very excited to come across an easy way to build a proxy without building a proxy. It involves using YQL and their insta-proxy service.

Here it is in action: https://github.com/htmlpreview/htmlpreview.github.com

If my hunch is right, we might be able to inject javascripts to proxied pages with this.