简体   繁体   中英

Is it conceptually possible to create a javascript bookmarklet to copy and paste html form entries?

I think this is what they are talking about on this page , but I'm not sure.

What I am looking for is a bookmarklet I can add to the toolbar of my browser, like the ones on this page . This hypothetical script would work much like the Windows clipboard, except that it would copy an entire set of entries in a web form with the click of one button, and then paste those same entries back into a second form with identical fields, on a different website.

The closest I've been able to find to what I want is this Firefox addon , which looks like it would be perfect, except that it's browser dependent, which wouldn't be a dealbreaker. But in fact it's been abandoned and won't even work in the latest version of Firefox any more, so it's pretty much useless.

I don't know enough about javascript to know if this is even possible in theory, hence this question.

The part of pasting what's copied to a second identified source with it's own form fields may not be possible. A bookmarklet for extracting the values of a form may be easily found.

http://ostermiller.org/bookmarklets/

I'm attempting something similar, via bookmarklet would be nice but I settled for the firefox addons. Please share if you've found a better solution.

This link says Opera also has a built in capability to insert greasmonkey scripts. http://my.opera.com/thibi/blog/firefox-to-opera

I don't think that it's possible - you would need cross-domain scripting for that. You could put it in the real clipoard (json-encoded or so), but that's not possible in all/most browsers for security reasons. What I could imagine is making a javascript-popup with the json-encoded data that the user could copy or so after reading the form data and a javascript input that pops up when "pasting" that asks you to press CTRL+V.

Why don't you make it an add-on?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM