开发者

JavaScript Bookmarklet to open new Window and transmit params of origin Page

开发者 https://www.devze.com 2023-04-06 13:45 出处:网络
I have a perfectly working bookmarklet to grab the Document-Title and the URL of the current Website and place it into the URL of the new loaded Page (Code below) … now I wonder how to let this doma

I have a perfectly working bookmarklet to grab the Document-Title and the URL of the current Website and place it into the URL of the new loaded Page (Code below) … now I wonder how to let this domain.com/bookmarklet?… open in a new small window (600x600px), so that I still see the old website from where I grabed the title and url in the background and have the new page (domain.com/bookmarklet?…) in the foreground.

javascript:location.href='http://domain.com/bookmarklet?url='+encodeU开发者_StackOverflow社区RIComponent(location.href)+';title='+encodeURIComponent(document.title)

How can I achieve that?


Use window.open(...) instead of setting location.href = ....


you need to use window.open() for that

javascript:window.open ("http://domain.com/bookmarklet?.......","MyBookmarklet");
0

精彩评论

暂无评论...
验证码 换一张
取 消