Rewrite iOS link behaviour javascript