diff --git a/src/background/background.js b/src/background/background.js index 87d7583..eef4962 100644 --- a/src/background/background.js +++ b/src/background/background.js @@ -17,13 +17,4 @@ chrome.runtime.onInstalled.addListener(function() { }) }) open(chrome.extension.getURL("views/options/options.html")); - chrome.declarativeContent.onPageChanged.removeRules(undefined, function() { - chrome.declarativeContent.onPageChanged.addRules([{ - conditions: [new chrome.declarativeContent.PageStateMatcher({ - pageUrl: {hostEquals: 'www.worldcubeassociation.org'}, - }) - ], - actions: [new chrome.declarativeContent.ShowPageAction()] - }]); - }); }); \ No newline at end of file diff --git a/src/images/logo2.png b/src/images/logo2.png new file mode 100644 index 0000000..4acbb00 Binary files /dev/null and b/src/images/logo2.png differ diff --git a/src/images/wcaaddons.png b/src/images/wcaaddons.png new file mode 100644 index 0000000..130c573 Binary files /dev/null and b/src/images/wcaaddons.png differ diff --git a/src/manifest.json b/src/manifest.json index 180f51f..4ee1907 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,8 +1,8 @@ { "name": "wcaddons", - "version": "0.0.1", + "version": "0.0.2", "description": "Features to enchance your worldcubeassociation.org experience", - "permissions":["declarativeContent","storage","tabs","https://www.worldcubeassociation.org/*"], + "permissions":["storage","tabs"], "web_accessible_resources": [ "images/*.*" ], @@ -15,7 +15,7 @@ "css":["content/content.css"], "matches":["https://www.worldcubeassociation.org/persons/*"] }], - "page_action": { + "browser_action": { "default_popup": "views/popup/popup.html", "default_icon": { "16":"images/logo.png" @@ -33,5 +33,5 @@ }, "options_page": "views/options/options.html", "manifest_version": 2, - "content_security_policy": "script-src 'self' https://unpkg.com/react-dom@17/umd/react-dom.production.min.js https://unpkg.com/react@17/umd/react.production.min.js https://cdnjs.cloudflare.com/ajax/libs/react-bootstrap-table/4.3.1/react-bootstrap-table.min https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js https://unpkg.com/react@17/umd/react.development.js https://unpkg.com/react-dom@17/umd/react-dom.development.js; object-src 'self'" + "content_security_policy": "script-src 'self' https://unpkg.com/react-dom@17/umd/react-dom.production.min.js https://unpkg.com/react@17/umd/react.production.min.js https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js https://unpkg.com/react@17/umd/react.development.js https://unpkg.com/react-dom@17/umd/react-dom.development.js; object-src 'self'" } \ No newline at end of file diff --git a/src/views/react-test/components/options.js b/src/views/react-test/components/options.js new file mode 100644 index 0000000..19c9509 --- /dev/null +++ b/src/views/react-test/components/options.js @@ -0,0 +1,77 @@ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Options = function (_React$Component) { + _inherits(Options, _React$Component); + + function Options(props) { + _classCallCheck(this, Options); + + var _this = _possibleConstructorReturn(this, (Options.__proto__ || Object.getPrototypeOf(Options)).call(this, props)); + + _this.state = { value: 'time' }; + + _this.handleChange = _this.handleChange.bind(_this); + _this.handleSubmit = _this.handleSubmit.bind(_this); + return _this; + } + + _createClass(Options, [{ + key: 'handleChange', + value: function handleChange(event) { + this.setState({ value: event.target.value }); + } + }, { + key: 'handleSubmit', + value: function handleSubmit(event) { + event.preventDefault(); + this.props.mode(this.state.value); + } + }, { + key: 'render', + value: function render() { + return React.createElement( + 'form', + { onSubmit: this.handleSubmit }, + React.createElement( + 'label', + null, + React.createElement( + 'select', + { value: this.state.value, onChange: this.handleChange }, + React.createElement( + 'option', + { value: 'time' }, + 'time' + ), + React.createElement( + 'option', + { value: 'worldRank' }, + 'wr' + ), + React.createElement( + 'option', + { value: 'continentRank' }, + 'cr' + ), + React.createElement( + 'option', + { value: 'countryRank' }, + 'nr' + ) + ) + ), + React.createElement('input', { type: 'submit', value: 'Submit' }) + ); + } + }]); + + return Options; +}(React.Component); \ No newline at end of file diff --git a/src/views/react-test/src/components/options.js b/src/views/react-test/src/components/options.js new file mode 100644 index 0000000..e2c8046 --- /dev/null +++ b/src/views/react-test/src/components/options.js @@ -0,0 +1,37 @@ +'use strict'; + +class Options extends React.Component { + constructor(props) { + super(props); + this.state = {value: 'time'}; + + this.handleChange = this.handleChange.bind(this); + this.handleSubmit = this.handleSubmit.bind(this); + } + + handleChange(event) { + this.setState({value: event.target.value}); + + } + + handleSubmit(event) { + event.preventDefault(); + this.props.mode(this.state.value); + } + + render() { + return ( +
+ ); + } + } \ No newline at end of file