add javascirpt pattern used in Fxos window management