implement bookmarklet function