split chrome and plugin javascript