bookmarklet function wrapper