This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/components/honeypot-input.js.es6
2019-11-07 15:38:28 -06:00

17 lines
489 B
JavaScript

import { on } from "discourse-common/utils/decorators";
export default Ember.TextField.extend({
@on("init")
_init() {
// Chrome autocomplete is buggy per:
// https://bugs.chromium.org/p/chromium/issues/detail?id=987293
// work around issue while leaving a semi useable honeypot for
// bots that are running full Chrome
if (navigator.userAgent.indexOf("Chrome") > -1) {
this.set("type", "text");
} else {
this.set("type", "password");
}
}
});