[
  {
    "path": ".gitignore",
    "content": "build/\npackage-lock.json\nnode_modules/\n.idea/\n.vscode/\nyarn.lock"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2018 Satendra Rai\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "[![Chrome Web Store](https://img.shields.io/chrome-web-store/v/dlbnejfbjfikckofdndbjndhhbplmnpj.svg?colorB=%234FC828&style=flat)](https://chrome.google.com/webstore/detail/testing-extension/dlbnejfbjfikckofdndbjndhhbplmnpj)\n[![Chrome Web Store Rating](https://img.shields.io/chrome-web-store/stars/ibomigipadcieapbemkegkmadbbanbgm.svg?colorB=%234FC828&label=rating&style=flat)](https://chrome.google.com/webstore/detail/testing-extension/dlbnejfbjfikckofdndbjndhhbplmnpj)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/omergulen/testing-extension/blob/master/LICENSE)\n\n# Copycat - Testing Extension\n\n<img src=\"./public/icon256.png\" />\n\n## (for jest-puppeteer)\nThis extension is built to ease creating web tests. It is like Selenium-IDE, but for jest-puppeteer (for now).\n\nAlso, this extension records actions on your own browser, so it doesn't need to open up new Selenium or Puppeteer window to record your actions on it.\n\nIn recording state it records the events which are stated below with the target elements unique selector.\n\n### Supported Actions\n\n#### Click origined events\n\n| Action Key    | Description   |\n| --------------------- | ------------- |\n| `click`       | Mouse `click` event. |\n| `mousedown`       | Mouse `mousedown` event. |\n| `drag-and-drop` | If `mouseup` event comes after `mousedown` event and the difference between their coordinates is greater than 10. |\n\n#### Key originated events\n\n| Action Key    | Description   |\n| --------------------- | ------------- |\n| `keydown`       | Keyboard `keydown` event. It automaticly gathers the `keydown` events into one if they consecutive triggered and their selectors are the same. |\n| `combined-keydown`       | It combines special keydown events if they are trigged at the same time, example: `Ctrl+A`. |\n\n#### Page change events\n\n| Action Key    | Description   |\n| --------------------- | ------------- |\n| `page-change`       | If `onbeforeunload` event is triggered. |\n| `click-page-change` | If `onbeforeunload` event of the window comes after `click` or `mousedown` event. |\n\n#### Verify events\n\nTriggers with right click on the element and choose proper verify action.\n\n| Action Key    | Description   |\n| --------------------- | ------------- |\n| `verify-text`       | It gets the right clicked element's `text` and matches with the `textContent` of the element in the test. |\n| `verify-link`       | It gets the right clicked element's `href` and matches with the `href` of the element in the test. |\n| `verify-DOM`       | It gets the right clicked element and check if it exists in the test. |\n\n## Installation\n\n### Google Web Store\n[Install on Chrome Web Store](https://chrome.google.com/webstore/detail/testing-extension/dlbnejfbjfikckofdndbjndhhbplmnpj)   \n\n<a href=\"https://chrome.google.com/webstore/detail/testing-extension/dlbnejfbjfikckofdndbjndhhbplmnpj\"><img src=\"https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_128x128.png\" width=\"48\" /></a>\n\nor \n\n### Manual Installation\n\n```\ngit clone https://github.com/omergulen/copycat.git\n```\nGo to `copycat` directory run\n\n```\nyarn install\n```\nNow build the extension using\n```\nyarn build\n```\nYou will see a `build` folder generated inside `[PROJECT_HOME]`\n\n#### Adding Copycat to Chrome\n\nIn Chrome browser, go to `chrome://extensions` page and switch on developer mode. This enables the ability to locally install a Chrome extension.\n\n<img src=\"https://cdn-images-1.medium.com/max/1600/1*OaygCwLSwLakyTqCADbmDw.png\" />\n\nNow click on the `LOAD UNPACKED` and browse to `[PROJECT_HOME]\\build` ,This will install the React app as a Chrome extension.\n\nWhen you go to any website and click on extension icon, injected page will toggle.\n\n<img src=\"./assets/extension_test.png\" />\n\n<img src=\"./assets/extension_test2.png\" />\n\n<img src=\"./assets/close_on_hover.png\" />\n\nRemove unwanted actions on hover.\n\n## Usage - Testing Environment\n\n### Installation of jest-puppeteer\n\n```bash\n# for jest 22~23\nyarn add --save-dev jest-puppeteer@3.9.0 puppeteer jest\n# for jest 24+\nyarn add --save-dev jest-puppeteer puppeteer jest\n```\nor\n\n```bash\n# for jest 22~23\nnpm install --save-dev jest-puppeteer@3.9.0 puppeteer jest\n# for jest 24+\nnpm install --save-dev jest-puppeteer puppeteer jest\n```\n\n### Update Jest configuration\n\nCreate `jest.config.js` in the root of your testing environment.\n\n```\nmodule.exports = {\n  \"preset\": \"jest-puppeteer\"\n}\n```\n\n\n### Creating `__tests__` folder\n\nTo work with default `jest-puppeteer` preset, you need to put your test files into the `__tests__` folder in the root of your testing environment.\n\n\n### Basic Test Output Code\n\nFollowing test example in the GIF will generate such code. It starts in [my GitHub Profile](https://github.com/omergulen) and clicks one of the pinned repositories (testing-extension) and when page changes it checks for the repository title's `href` is `https://github.com/omergulen/copycat` or not.\n\n\n```\ndescribe('Test 1', () => {\n\tbeforeAll(async () => {\n\t\tawait page.goto('https://github.com/omergulen');\n\t});\n\n\tit('Test 1 - 1', async () => {\n\t\tawait Promise.all([\n\t\t\tpage.click(':nth-child(2) > .Box > .pinned-item-list-item-content > .d-flex > .text-bold > .repo'),\n\t\t\tpage.waitForNavigation()\n\t\t]);\n\t\tvar nodeLink = await page.$$eval('strong > a', el => el[0].href)\n\t\texpect(nodeLink).toBe('https://github.com/omergulen/copycat');\n\t}, 60000);\n});\n```\n\n\n<img src=\"./assets/test_example.gif\" />\n\n\n### Update Puppeteer configuration _(optional)_\n\nCreate `jest-puppeteer.config.js` in the root of your testing environment.\n```\nmodule.exports = {\n  launch: {\n    headless: false, // Disable headless chromium\n    defaultViewport: null // Set page fit to the browser\n  },\n  browserContext: 'default',\n}\n```\n\n### Adding `test` command to the project configuration\n\nIn your project's `package.json` file, insert `\"test\": \"jest\"` line into the `\"scripts\"` object.\n\nIt will basicly look something like that:\n```\n{\n  \"scripts\": {\n    \"test\": \"jest\"\n  },\n  \"devDependencies\": {\n    \"jest-puppeteer\": \"^4.3.0\"\n  },\n  \"dependencies\": {\n    \"jest\": \"^24.8.0\",\n    \"puppeteer\": \"^1.19.0\"\n  }\n}\n```\n\n### Running tests\n\n`yarn run test` or `npm run test` will do.\n\n<img src=\"./assets/run_test.png\" />\n\n## Contribution\n\nBug reports and pull requests are welcome on GitHub at https://github.com/omergulen/testing-extension. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct\n\n\n## License\n\nThe repo is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n"
  },
  {
    "path": "config/env.js",
    "content": "'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\nconst paths = require('./paths');\n\n// Make sure that including paths.js after env.js will read .env variables.\ndelete require.cache[require.resolve('./paths')];\n\nconst NODE_ENV = process.env.NODE_ENV;\nif (!NODE_ENV) {\n  throw new Error(\n    'The NODE_ENV environment variable is required but was not specified.'\n  );\n}\n\n// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use\nvar dotenvFiles = [\n  `${paths.dotenv}.${NODE_ENV}.local`,\n  `${paths.dotenv}.${NODE_ENV}`,\n  // Don't include `.env.local` for `test` environment\n  // since normally you expect tests to produce the same\n  // results for everyone\n  NODE_ENV !== 'test' && `${paths.dotenv}.local`,\n  paths.dotenv,\n].filter(Boolean);\n\n// Load environment variables from .env* files. Suppress warnings using silent\n// if this file is missing. dotenv will never modify any environment variables\n// that have already been set.  Variable expansion is supported in .env files.\n// https://github.com/motdotla/dotenv\n// https://github.com/motdotla/dotenv-expand\ndotenvFiles.forEach(dotenvFile => {\n  if (fs.existsSync(dotenvFile)) {\n    require('dotenv-expand')(\n      require('dotenv').config({\n        path: dotenvFile,\n      })\n    );\n  }\n});\n\n// We support resolving modules according to `NODE_PATH`.\n// This lets you use absolute paths in imports inside large monorepos:\n// https://github.com/facebookincubator/create-react-app/issues/253.\n// It works similar to `NODE_PATH` in Node itself:\n// https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders\n// Note that unlike in Node, only *relative* paths from `NODE_PATH` are honored.\n// Otherwise, we risk importing Node.js core modules into an app instead of Webpack shims.\n// https://github.com/facebookincubator/create-react-app/issues/1023#issuecomment-265344421\n// We also resolve them to make sure all tools using them work consistently.\nconst appDirectory = fs.realpathSync(process.cwd());\nprocess.env.NODE_PATH = (process.env.NODE_PATH || '')\n  .split(path.delimiter)\n  .filter(folder => folder && !path.isAbsolute(folder))\n  .map(folder => path.resolve(appDirectory, folder))\n  .join(path.delimiter);\n\n// Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be\n// injected into the application via DefinePlugin in Webpack configuration.\nconst REACT_APP = /^REACT_APP_/i;\n\nfunction getClientEnvironment(publicUrl) {\n  const raw = Object.keys(process.env)\n    .filter(key => REACT_APP.test(key))\n    .reduce(\n      (env, key) => {\n        env[key] = process.env[key];\n        return env;\n      },\n      {\n        // Useful for determining whether we’re running in production mode.\n        // Most importantly, it switches React into the correct mode.\n        NODE_ENV: process.env.NODE_ENV || 'development',\n        // Useful for resolving the correct path to static assets in `public`.\n        // For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />.\n        // This should only be used as an escape hatch. Normally you would put\n        // images into the `src` and `import` them in code to get their paths.\n        PUBLIC_URL: publicUrl,\n      }\n    );\n  // Stringify all values so we can feed into Webpack DefinePlugin\n  const stringified = {\n    'process.env': Object.keys(raw).reduce((env, key) => {\n      env[key] = JSON.stringify(raw[key]);\n      return env;\n    }, {}),\n  };\n\n  return { raw, stringified };\n}\n\nmodule.exports = getClientEnvironment;\n"
  },
  {
    "path": "config/jest/cssTransform.js",
    "content": "'use strict';\n\n// This is a custom Jest transformer turning style imports into empty objects.\n// http://facebook.github.io/jest/docs/en/webpack.html\n\nmodule.exports = {\n  process() {\n    return 'module.exports = {};';\n  },\n  getCacheKey() {\n    // The output is always the same.\n    return 'cssTransform';\n  },\n};\n"
  },
  {
    "path": "config/jest/fileTransform.js",
    "content": "'use strict';\n\nconst path = require('path');\n\n// This is a custom Jest transformer turning file imports into filenames.\n// http://facebook.github.io/jest/docs/en/webpack.html\n\nmodule.exports = {\n  process(src, filename) {\n    return `module.exports = ${JSON.stringify(path.basename(filename))};`;\n  },\n};\n"
  },
  {
    "path": "config/paths.js",
    "content": "'use strict';\n\nconst path = require('path');\nconst fs = require('fs');\nconst url = require('url');\n\n// Make sure any symlinks in the project folder are resolved:\n// https://github.com/facebookincubator/create-react-app/issues/637\nconst appDirectory = fs.realpathSync(process.cwd());\nconst resolveApp = relativePath => path.resolve(appDirectory, relativePath);\n\nconst envPublicUrl = process.env.PUBLIC_URL;\n\nfunction ensureSlash(path, needsSlash) {\n  const hasSlash = path.endsWith('/');\n  if (hasSlash && !needsSlash) {\n    return path.substr(path, path.length - 1);\n  } else if (!hasSlash && needsSlash) {\n    return `${path}/`;\n  } else {\n    return path;\n  }\n}\n\nconst getPublicUrl = appPackageJson =>\n  envPublicUrl || require(appPackageJson).homepage;\n\n// We use `PUBLIC_URL` environment variable or \"homepage\" field to infer\n// \"public path\" at which the app is served.\n// Webpack needs to know it to put the right <script> hrefs into HTML even in\n// single-page apps that may serve index.html for nested URLs like /todos/42.\n// We can't use a relative path in HTML because we don't want to load something\n// like /todos/42/static/js/bundle.7289d.js. We have to know the root.\nfunction getServedPath(appPackageJson) {\n  const publicUrl = getPublicUrl(appPackageJson);\n  const servedUrl =\n    envPublicUrl || (publicUrl ? url.parse(publicUrl).pathname : '/');\n  return ensureSlash(servedUrl, true);\n}\n\n// config after eject: we're in ./config/\nmodule.exports = {\n  dotenv: resolveApp('.env'),\n  appBuild: resolveApp('build'),\n  appPublic: resolveApp('public'),\n  appHtml: resolveApp('public/index.html'),\n  appIndexJs: resolveApp('src/index.js'),\n  appPackageJson: resolveApp('package.json'),\n  appSrc: resolveApp('src'),\n  yarnLockFile: resolveApp('yarn.lock'),\n  testsSetup: resolveApp('src/setupTests.js'),\n  appNodeModules: resolveApp('node_modules'),\n  publicUrl: getPublicUrl(resolveApp('package.json')),\n  servedPath: getServedPath(resolveApp('package.json')),\n};\n"
  },
  {
    "path": "config/polyfills.js",
    "content": "'use strict';\n\nif (typeof Promise === 'undefined') {\n  // Rejection tracking prevents a common issue where React gets into an\n  // inconsistent state due to an error, but it gets swallowed by a Promise,\n  // and the user has no idea what causes React's erratic future behavior.\n  require('promise/lib/rejection-tracking').enable();\n  window.Promise = require('promise/lib/es6-extensions.js');\n}\n\n// fetch() polyfill for making API calls.\nrequire('whatwg-fetch');\n\n// Object.assign() is commonly used with React.\n// It will use the native implementation if it's present and isn't buggy.\nObject.assign = require('object-assign');\n\n// In tests, polyfill requestAnimationFrame since jsdom doesn't provide it yet.\n// We don't polyfill it in the browser--this is user's responsibility.\nif (process.env.NODE_ENV === 'test') {\n  require('raf').polyfill(global);\n}\n"
  },
  {
    "path": "config/webpack.config.dev.js",
    "content": "'use strict';\n\nconst autoprefixer = require('autoprefixer');\nconst path = require('path');\nconst webpack = require('webpack');\nconst HtmlWebpackPlugin = require('html-webpack-plugin');\nconst CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');\nconst InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');\nconst WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');\nconst eslintFormatter = require('react-dev-utils/eslintFormatter');\nconst ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');\nconst getClientEnvironment = require('./env');\nconst paths = require('./paths');\n\n// Webpack uses `publicPath` to determine where the app is being served from.\n// In development, we always serve from the root. This makes config easier.\nconst publicPath = '/';\n// `publicUrl` is just like `publicPath`, but we will provide it to our app\n// as %PUBLIC_URL% in `index.html` and `process.env.PUBLIC_URL` in JavaScript.\n// Omit trailing slash as %PUBLIC_PATH%/xyz looks better than %PUBLIC_PATH%xyz.\nconst publicUrl = '';\n// Get environment variables to inject into our app.\nconst env = getClientEnvironment(publicUrl);\n\n// This is the development configuration.\n// It is focused on developer experience and fast rebuilds.\n// The production configuration is different and lives in a separate file.\nmodule.exports = {\n  // You may want 'eval' instead if you prefer to see the compiled output in DevTools.\n  // See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.\n  devtool: 'cheap-module-source-map',\n  // These are the \"entry points\" to our application.\n  // This means they will be the \"root\" imports that are included in JS bundle.\n  // The first two entry points enable \"hot\" CSS and auto-refreshes for JS.\n  entry: [\n    // We ship a few polyfills by default:\n    require.resolve('./polyfills'),\n    // Include an alternative client for WebpackDevServer. A client's job is to\n    // connect to WebpackDevServer by a socket and get notified about changes.\n    // When you save a file, the client will either apply hot updates (in case\n    // of CSS changes), or refresh the page (in case of JS changes). When you\n    // make a syntax error, this client will display a syntax error overlay.\n    // Note: instead of the default WebpackDevServer client, we use a custom one\n    // to bring better experience for Create React App users. You can replace\n    // the line below with these two lines if you prefer the stock client:\n    // require.resolve('webpack-dev-server/client') + '?/',\n    // require.resolve('webpack/hot/dev-server'),\n    require.resolve('react-dev-utils/webpackHotDevClient'),\n    // Finally, this is your app's code:\n    paths.appIndexJs,\n    // We include the app code last so that if there is a runtime error during\n    // initialization, it doesn't blow up the WebpackDevServer client, and\n    // changing JS code would still trigger a refresh.\n  ],\n  output: {\n    // Add /* filename */ comments to generated require()s in the output.\n    pathinfo: true,\n    // This does not produce a real file. It's just the virtual path that is\n    // served by WebpackDevServer in development. This is the JS bundle\n    // containing code from all our entry points, and the Webpack runtime.\n    filename: 'static/js/bundle.js',\n    // There are also additional JS chunk files if you use code splitting.\n    chunkFilename: 'static/js/[name].chunk.js',\n    // This is the URL that app is served from. We use \"/\" in development.\n    publicPath: publicPath,\n    // Point sourcemap entries to original disk location (format as URL on Windows)\n    devtoolModuleFilenameTemplate: info =>\n      path.resolve(info.absoluteResourcePath).replace(/\\\\/g, '/'),\n  },\n  resolve: {\n    // This allows you to set a fallback for where Webpack should look for modules.\n    // We placed these paths second because we want `node_modules` to \"win\"\n    // if there are any conflicts. This matches Node resolution mechanism.\n    // https://github.com/facebookincubator/create-react-app/issues/253\n    modules: ['node_modules', paths.appNodeModules].concat(\n      // It is guaranteed to exist because we tweak it in `env.js`\n      process.env.NODE_PATH.split(path.delimiter).filter(Boolean)\n    ),\n    // These are the reasonable defaults supported by the Node ecosystem.\n    // We also include JSX as a common component filename extension to support\n    // some tools, although we do not recommend using it, see:\n    // https://github.com/facebookincubator/create-react-app/issues/290\n    // `web` extension prefixes have been added for better support\n    // for React Native Web.\n    extensions: ['.web.js', '.mjs', '.js', '.json', '.web.jsx', '.jsx'],\n    alias: {\n      \n      // Support React Native Web\n      // https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/\n      'react-native': 'react-native-web',\n    },\n    plugins: [\n      // Prevents users from importing files from outside of src/ (or node_modules/).\n      // This often causes confusion because we only process files within src/ with babel.\n      // To fix this, we prevent you from importing files out of src/ -- if you'd like to,\n      // please link the files into your node_modules/ and let module-resolution kick in.\n      // Make sure your source files are compiled, as they will not be processed in any way.\n      new ModuleScopePlugin(paths.appSrc, [paths.appPackageJson]),\n    ],\n  },\n  module: {\n    strictExportPresence: true,\n    rules: [\n      // TODO: Disable require.ensure as it's not a standard language feature.\n      // We are waiting for https://github.com/facebookincubator/create-react-app/issues/2176.\n      // { parser: { requireEnsure: false } },\n\n      // First, run the linter.\n      // It's important to do this before Babel processes the JS.\n      {\n        test: /\\.(js|jsx|mjs)$/,\n        enforce: 'pre',\n        use: [\n          {\n            options: {\n              formatter: eslintFormatter,\n              eslintPath: require.resolve('eslint'),\n              \n            },\n            loader: require.resolve('eslint-loader'),\n          },\n        ],\n        include: paths.appSrc,\n      },\n      {\n        // \"oneOf\" will traverse all following loaders until one will\n        // match the requirements. When no loader matches it will fall\n        // back to the \"file\" loader at the end of the loader list.\n        oneOf: [\n          // \"url\" loader works like \"file\" loader except that it embeds assets\n          // smaller than specified limit in bytes as data URLs to avoid requests.\n          // A missing `test` is equivalent to a match.\n          {\n            test: [/\\.bmp$/, /\\.gif$/, /\\.jpe?g$/, /\\.png$/],\n            loader: require.resolve('url-loader'),\n            options: {\n              limit: 10000,\n              name: 'static/media/[name].[hash:8].[ext]',\n            },\n          },\n          // Process JS with Babel.\n          {\n            test: /\\.(js|jsx|mjs)$/,\n            include: paths.appSrc,\n            loader: require.resolve('babel-loader'),\n            options: {\n              \n              // This is a feature of `babel-loader` for webpack (not Babel itself).\n              // It enables caching results in ./node_modules/.cache/babel-loader/\n              // directory for faster rebuilds.\n              cacheDirectory: true,\n            },\n          },\n          // \"postcss\" loader applies autoprefixer to our CSS.\n          // \"css\" loader resolves paths in CSS and adds assets as dependencies.\n          // \"style\" loader turns CSS into JS modules that inject <style> tags.\n          // In production, we use a plugin to extract that CSS to a file, but\n          // in development \"style\" loader enables hot editing of CSS.\n          {\n            test: /\\.css$/,\n            use: [\n              require.resolve('style-loader'),\n              {\n                loader: require.resolve('css-loader'),\n                options: {\n                  importLoaders: 1,\n                },\n              },\n              {\n                loader: require.resolve('postcss-loader'),\n                options: {\n                  // Necessary for external CSS imports to work\n                  // https://github.com/facebookincubator/create-react-app/issues/2677\n                  ident: 'postcss',\n                  plugins: () => [\n                    require('postcss-flexbugs-fixes'),\n                    autoprefixer({\n                      browsers: [\n                        '>1%',\n                        'last 4 versions',\n                        'Firefox ESR',\n                        'not ie < 9', // React doesn't support IE8 anyway\n                      ],\n                      flexbox: 'no-2009',\n                    }),\n                  ],\n                },\n              },\n            ],\n          },\n          // \"file\" loader makes sure those assets get served by WebpackDevServer.\n          // When you `import` an asset, you get its (virtual) filename.\n          // In production, they would get copied to the `build` folder.\n          // This loader doesn't use a \"test\" so it will catch all modules\n          // that fall through the other loaders.\n          {\n            // Exclude `js` files to keep \"css\" loader working as it injects\n            // its runtime that would otherwise processed through \"file\" loader.\n            // Also exclude `html` and `json` extensions so they get processed\n            // by webpacks internal loaders.\n            exclude: [/\\.(js|jsx|mjs)$/, /\\.html$/, /\\.json$/],\n            loader: require.resolve('file-loader'),\n            options: {\n              name: 'static/media/[name].[hash:8].[ext]',\n            },\n          },\n        ],\n      },\n      // ** STOP ** Are you adding a new loader?\n      // Make sure to add the new loader(s) before the \"file\" loader.\n    ],\n  },\n  plugins: [\n    // Makes some environment variables available in index.html.\n    // The public URL is available as %PUBLIC_URL% in index.html, e.g.:\n    // <link rel=\"shortcut icon\" href=\"%PUBLIC_URL%/favicon.ico\">\n    // In development, this will be an empty string.\n    new InterpolateHtmlPlugin(env.raw),\n    // Generates an `index.html` file with the <script> injected.\n    new HtmlWebpackPlugin({\n      inject: true,\n      template: paths.appHtml,\n    }),\n    // Add module names to factory functions so they appear in browser profiler.\n    new webpack.NamedModulesPlugin(),\n    // Makes some environment variables available to the JS code, for example:\n    // if (process.env.NODE_ENV === 'development') { ... }. See `./env.js`.\n    new webpack.DefinePlugin(env.stringified),\n    // This is necessary to emit hot updates (currently CSS only):\n    new webpack.HotModuleReplacementPlugin(),\n    // Watcher doesn't work well if you mistype casing in a path so we use\n    // a plugin that prints an error when you attempt to do this.\n    // See https://github.com/facebookincubator/create-react-app/issues/240\n    new CaseSensitivePathsPlugin(),\n    // If you require a missing module and then `npm install` it, you still have\n    // to restart the development server for Webpack to discover it. This plugin\n    // makes the discovery automatic so you don't have to restart.\n    // See https://github.com/facebookincubator/create-react-app/issues/186\n    new WatchMissingNodeModulesPlugin(paths.appNodeModules),\n    // Moment.js is an extremely popular library that bundles large locale files\n    // by default due to how Webpack interprets its code. This is a practical\n    // solution that requires the user to opt into importing specific locales.\n    // https://github.com/jmblog/how-to-optimize-momentjs-with-webpack\n    // You can remove this if you don't use Moment.js:\n    new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/),\n  ],\n  // Some libraries import Node modules but don't use them in the browser.\n  // Tell Webpack to provide empty mocks for them so importing them works.\n  node: {\n    dgram: 'empty',\n    fs: 'empty',\n    net: 'empty',\n    tls: 'empty',\n    child_process: 'empty',\n  },\n  // Turn off performance hints during development because we don't do any\n  // splitting or minification in interest of speed. These warnings become\n  // cumbersome.\n  performance: {\n    hints: false,\n  },\n};\n"
  },
  {
    "path": "config/webpack.config.prod.js",
    "content": "'use strict';\n\nconst autoprefixer = require('autoprefixer');\nconst path = require('path');\nconst webpack = require('webpack');\nconst HtmlWebpackPlugin = require('html-webpack-plugin');\nconst ExtractTextPlugin = require('extract-text-webpack-plugin');\nconst ManifestPlugin = require('webpack-manifest-plugin');\nconst InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');\nconst SWPrecacheWebpackPlugin = require('sw-precache-webpack-plugin');\nconst eslintFormatter = require('react-dev-utils/eslintFormatter');\nconst ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');\nconst paths = require('./paths');\nconst getClientEnvironment = require('./env');\n\n// Webpack uses `publicPath` to determine where the app is being served from.\n// It requires a trailing slash, or the file assets will get an incorrect path.\nconst publicPath = paths.servedPath;\n// Some apps do not use client-side routing with pushState.\n// For these, \"homepage\" can be set to \".\" to enable relative asset paths.\nconst shouldUseRelativeAssetPaths = publicPath === './';\n// Source maps are resource heavy and can cause out of memory issue for large source files.\nconst shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== 'false';\n// `publicUrl` is just like `publicPath`, but we will provide it to our app\n// as %PUBLIC_URL% in `index.html` and `process.env.PUBLIC_URL` in JavaScript.\n// Omit trailing slash as %PUBLIC_URL%/xyz looks better than %PUBLIC_URL%xyz.\nconst publicUrl = publicPath.slice(0, -1);\n// Get environment variables to inject into our app.\nconst env = getClientEnvironment(publicUrl);\n\n// Assert this just to be safe.\n// Development builds of React are slow and not intended for production.\nif (env.stringified['process.env'].NODE_ENV !== '\"production\"') {\n  throw new Error('Production builds must have NODE_ENV=production.');\n}\n\n// Note: defined here because it will be used more than once.\nconst cssFilename = 'static/css/[name].css';\n\n// ExtractTextPlugin expects the build output to be flat.\n// (See https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/27)\n// However, our output is structured with css, js and media folders.\n// To have this structure working with relative paths, we have to use custom options.\nconst extractTextPluginOptions = shouldUseRelativeAssetPaths\n  ? // Making sure that the publicPath goes back to to build folder.\n    { publicPath: Array(cssFilename.split('/').length).join('../') }\n  : {};\n\n// This is the production configuration.\n// It compiles slowly and is focused on producing a fast and minimal bundle.\n// The development configuration is different and lives in a separate file.\nmodule.exports = {\n  // Don't attempt to continue if there are any errors.\n  bail: true,\n  // We generate sourcemaps in production. This is slow but gives good results.\n  // You can exclude the *.map files from the build during deployment.\n  devtool: shouldUseSourceMap ? 'source-map' : false,\n  // In production, we only want to load the polyfills and the app code.\n  entry: {\n    app: [require.resolve('./polyfills'), paths.appIndexJs],\n    content: [require.resolve('./polyfills'), './src/content.js']\n  },\n  output: {\n    // The build folder.\n    path: paths.appBuild,\n    // Generated JS file names (with nested folders).\n    // There will be one main bundle, and one file per asynchronous chunk.\n    // We don't currently advertise code splitting but Webpack supports it.\n    filename: 'static/js/[name].js',\n    chunkFilename: 'static/js/[name].[chunkhash:8].chunk.js',\n    // We inferred the \"public path\" (such as / or /my-project) from homepage.\n    publicPath: publicPath,\n    // Point sourcemap entries to original disk location (format as URL on Windows)\n    devtoolModuleFilenameTemplate: info =>\n      path\n        .relative(paths.appSrc, info.absoluteResourcePath)\n        .replace(/\\\\/g, '/'),\n  },\n  resolve: {\n    // This allows you to set a fallback for where Webpack should look for modules.\n    // We placed these paths second because we want `node_modules` to \"win\"\n    // if there are any conflicts. This matches Node resolution mechanism.\n    // https://github.com/facebookincubator/create-react-app/issues/253\n    modules: ['node_modules', paths.appNodeModules].concat(\n      // It is guaranteed to exist because we tweak it in `env.js`\n      process.env.NODE_PATH.split(path.delimiter).filter(Boolean)\n    ),\n    // These are the reasonable defaults supported by the Node ecosystem.\n    // We also include JSX as a common component filename extension to support\n    // some tools, although we do not recommend using it, see:\n    // https://github.com/facebookincubator/create-react-app/issues/290\n    // `web` extension prefixes have been added for better support\n    // for React Native Web.\n    extensions: ['.web.js', '.mjs', '.js', '.json', '.web.jsx', '.jsx'],\n    alias: {\n      \n      // Support React Native Web\n      // https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/\n      'react-native': 'react-native-web',\n    },\n    plugins: [\n      // Prevents users from importing files from outside of src/ (or node_modules/).\n      // This often causes confusion because we only process files within src/ with babel.\n      // To fix this, we prevent you from importing files out of src/ -- if you'd like to,\n      // please link the files into your node_modules/ and let module-resolution kick in.\n      // Make sure your source files are compiled, as they will not be processed in any way.\n      new ModuleScopePlugin(paths.appSrc, [paths.appPackageJson]),\n    ],\n  },\n  module: {\n    strictExportPresence: true,\n    rules: [\n      // TODO: Disable require.ensure as it's not a standard language feature.\n      // We are waiting for https://github.com/facebookincubator/create-react-app/issues/2176.\n      // { parser: { requireEnsure: false } },\n\n      // First, run the linter.\n      // It's important to do this before Babel processes the JS.\n      {\n        test: /\\.(js|jsx|mjs)$/,\n        enforce: 'pre',\n        use: [\n          {\n            options: {\n              formatter: eslintFormatter,\n              eslintPath: require.resolve('eslint'),\n              \n            },\n            loader: require.resolve('eslint-loader'),\n          },\n        ],\n        include: paths.appSrc,\n      },\n      {\n        // \"oneOf\" will traverse all following loaders until one will\n        // match the requirements. When no loader matches it will fall\n        // back to the \"file\" loader at the end of the loader list.\n        oneOf: [\n          // \"url\" loader works just like \"file\" loader but it also embeds\n          // assets smaller than specified size as data URLs to avoid requests.\n          {\n            test: [/\\.bmp$/, /\\.gif$/, /\\.jpe?g$/, /\\.png$/],\n            loader: require.resolve('url-loader'),\n            options: {\n              limit: 10000,\n              name: 'static/media/[name].[hash:8].[ext]',\n            },\n          },\n          // Process JS with Babel.\n          {\n            test: /\\.(js|jsx|mjs)$/,\n            include: paths.appSrc,\n            loader: require.resolve('babel-loader'),\n            options: {\n              \n              compact: true,\n            },\n          },\n          // The notation here is somewhat confusing.\n          // \"postcss\" loader applies autoprefixer to our CSS.\n          // \"css\" loader resolves paths in CSS and adds assets as dependencies.\n          // \"style\" loader normally turns CSS into JS modules injecting <style>,\n          // but unlike in development configuration, we do something different.\n          // `ExtractTextPlugin` first applies the \"postcss\" and \"css\" loaders\n          // (second argument), then grabs the result CSS and puts it into a\n          // separate file in our build process. This way we actually ship\n          // a single CSS file in production instead of JS code injecting <style>\n          // tags. If you use code splitting, however, any async bundles will still\n          // use the \"style\" loader inside the async code so CSS from them won't be\n          // in the main CSS file.\n          {\n            test: /\\.css$/,\n            loader: ExtractTextPlugin.extract(\n              Object.assign(\n                {\n                  fallback: {\n                    loader: require.resolve('style-loader'),\n                    options: {\n                      hmr: false,\n                    },\n                  },\n                  use: [\n                    {\n                      loader: require.resolve('css-loader'),\n                      options: {\n                        importLoaders: 1,\n                        minimize: true,\n                        sourceMap: shouldUseSourceMap,\n                      },\n                    },\n                    {\n                      loader: require.resolve('postcss-loader'),\n                      options: {\n                        // Necessary for external CSS imports to work\n                        // https://github.com/facebookincubator/create-react-app/issues/2677\n                        ident: 'postcss',\n                        plugins: () => [\n                          require('postcss-flexbugs-fixes'),\n                          autoprefixer({\n                            browsers: [\n                              '>1%',\n                              'last 4 versions',\n                              'Firefox ESR',\n                              'not ie < 9', // React doesn't support IE8 anyway\n                            ],\n                            flexbox: 'no-2009',\n                          }),\n                        ],\n                      },\n                    },\n                  ],\n                },\n                extractTextPluginOptions\n              )\n            ),\n            // Note: this won't work without `new ExtractTextPlugin()` in `plugins`.\n          },\n          // \"file\" loader makes sure assets end up in the `build` folder.\n          // When you `import` an asset, you get its filename.\n          // This loader doesn't use a \"test\" so it will catch all modules\n          // that fall through the other loaders.\n          {\n            loader: require.resolve('file-loader'),\n            // Exclude `js` files to keep \"css\" loader working as it injects\n            // it's runtime that would otherwise processed through \"file\" loader.\n            // Also exclude `html` and `json` extensions so they get processed\n            // by webpacks internal loaders.\n            exclude: [/\\.(js|jsx|mjs)$/, /\\.html$/, /\\.json$/],\n            options: {\n              name: 'static/media/[name].[hash:8].[ext]',\n            },\n          },\n          // ** STOP ** Are you adding a new loader?\n          // Make sure to add the new loader(s) before the \"file\" loader.\n        ],\n      },\n    ],\n  },\n  plugins: [\n    // Makes some environment variables available in index.html.\n    // The public URL is available as %PUBLIC_URL% in index.html, e.g.:\n    // <link rel=\"shortcut icon\" href=\"%PUBLIC_URL%/favicon.ico\">\n    // In production, it will be an empty string unless you specify \"homepage\"\n    // in `package.json`, in which case it will be the pathname of that URL.\n    new InterpolateHtmlPlugin(env.raw),\n    // Generates an `index.html` file with the <script> injected.\n    new HtmlWebpackPlugin({\n      inject: true,\n      template: paths.appHtml,\n      minify: {\n        removeComments: true,\n        collapseWhitespace: true,\n        removeRedundantAttributes: true,\n        useShortDoctype: true,\n        removeEmptyAttributes: true,\n        removeStyleLinkTypeAttributes: true,\n        keepClosingSlash: true,\n        minifyJS: true,\n        minifyCSS: true,\n        minifyURLs: true,\n      },\n    }),\n    // Makes some environment variables available to the JS code, for example:\n    // if (process.env.NODE_ENV === 'production') { ... }. See `./env.js`.\n    // It is absolutely essential that NODE_ENV was set to production here.\n    // Otherwise React will be compiled in the very slow development mode.\n    new webpack.DefinePlugin(env.stringified),\n    // Minify the code.\n    new webpack.optimize.UglifyJsPlugin({\n      compress: {\n        warnings: false,\n        // Disabled because of an issue with Uglify breaking seemingly valid code:\n        // https://github.com/facebookincubator/create-react-app/issues/2376\n        // Pending further investigation:\n        // https://github.com/mishoo/UglifyJS2/issues/2011\n        comparisons: false,\n      },\n      mangle: {\n        safari10: true,\n      },\n      output: {\n        comments: false,\n        // Turned on because emoji and regex is not minified properly using default\n        // https://github.com/facebookincubator/create-react-app/issues/2488\n        ascii_only: true,\n      },\n      sourceMap: shouldUseSourceMap,\n    }),\n    // Note: this won't work without ExtractTextPlugin.extract(..) in `loaders`.\n    new ExtractTextPlugin({\n      filename: cssFilename,\n    }),\n    // Generate a manifest file which contains a mapping of all asset filenames\n    // to their corresponding output file so that tools can pick it up without\n    // having to parse `index.html`.\n    new ManifestPlugin({\n      fileName: 'asset-manifest.json',\n    }),\n    // Generate a service worker script that will precache, and keep up to date,\n    // the HTML & assets that are part of the Webpack build.\n    new SWPrecacheWebpackPlugin({\n      // By default, a cache-busting query parameter is appended to requests\n      // used to populate the caches, to ensure the responses are fresh.\n      // If a URL is already hashed by Webpack, then there is no concern\n      // about it being stale, and the cache-busting can be skipped.\n      dontCacheBustUrlsMatching: /\\.\\w{8}\\./,\n      filename: 'service-worker.js',\n      logger(message) {\n        if (message.indexOf('Total precache size is') === 0) {\n          // This message occurs for every build and is a bit too noisy.\n          return;\n        }\n        if (message.indexOf('Skipping static resource') === 0) {\n          // This message obscures real errors so we ignore it.\n          // https://github.com/facebookincubator/create-react-app/issues/2612\n          return;\n        }\n        console.log(message);\n      },\n      minify: true,\n      // For unknown URLs, fallback to the index page\n      navigateFallback: publicUrl + '/index.html',\n      // Ignores URLs starting from /__ (useful for Firebase):\n      // https://github.com/facebookincubator/create-react-app/issues/2237#issuecomment-302693219\n      navigateFallbackWhitelist: [/^(?!\\/__).*/],\n      // Don't precache sourcemaps (they're large) and build asset manifest:\n      staticFileGlobsIgnorePatterns: [/\\.map$/, /asset-manifest\\.json$/],\n    }),\n    // Moment.js is an extremely popular library that bundles large locale files\n    // by default due to how Webpack interprets its code. This is a practical\n    // solution that requires the user to opt into importing specific locales.\n    // https://github.com/jmblog/how-to-optimize-momentjs-with-webpack\n    // You can remove this if you don't use Moment.js:\n    new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/),\n  ],\n  // Some libraries import Node modules but don't use them in the browser.\n  // Tell Webpack to provide empty mocks for them so importing them works.\n  node: {\n    dgram: 'empty',\n    fs: 'empty',\n    net: 'empty',\n    tls: 'empty',\n    child_process: 'empty',\n  },\n};\n"
  },
  {
    "path": "config/webpackDevServer.config.js",
    "content": "'use strict';\n\nconst errorOverlayMiddleware = require('react-dev-utils/errorOverlayMiddleware');\nconst noopServiceWorkerMiddleware = require('react-dev-utils/noopServiceWorkerMiddleware');\nconst ignoredFiles = require('react-dev-utils/ignoredFiles');\nconst config = require('./webpack.config.dev');\nconst paths = require('./paths');\n\nconst protocol = process.env.HTTPS === 'true' ? 'https' : 'http';\nconst host = process.env.HOST || '0.0.0.0';\n\nmodule.exports = function(proxy, allowedHost) {\n  return {\n    // WebpackDevServer 2.4.3 introduced a security fix that prevents remote\n    // websites from potentially accessing local content through DNS rebinding:\n    // https://github.com/webpack/webpack-dev-server/issues/887\n    // https://medium.com/webpack/webpack-dev-server-middleware-security-issues-1489d950874a\n    // However, it made several existing use cases such as development in cloud\n    // environment or subdomains in development significantly more complicated:\n    // https://github.com/facebookincubator/create-react-app/issues/2271\n    // https://github.com/facebookincubator/create-react-app/issues/2233\n    // While we're investigating better solutions, for now we will take a\n    // compromise. Since our WDS configuration only serves files in the `public`\n    // folder we won't consider accessing them a vulnerability. However, if you\n    // use the `proxy` feature, it gets more dangerous because it can expose\n    // remote code execution vulnerabilities in backends like Django and Rails.\n    // So we will disable the host check normally, but enable it if you have\n    // specified the `proxy` setting. Finally, we let you override it if you\n    // really know what you're doing with a special environment variable.\n    disableHostCheck:\n      !proxy || process.env.DANGEROUSLY_DISABLE_HOST_CHECK === 'true',\n    // Enable gzip compression of generated files.\n    compress: true,\n    // Silence WebpackDevServer's own logs since they're generally not useful.\n    // It will still show compile warnings and errors with this setting.\n    clientLogLevel: 'none',\n    // By default WebpackDevServer serves physical files from current directory\n    // in addition to all the virtual build products that it serves from memory.\n    // This is confusing because those files won’t automatically be available in\n    // production build folder unless we copy them. However, copying the whole\n    // project directory is dangerous because we may expose sensitive files.\n    // Instead, we establish a convention that only files in `public` directory\n    // get served. Our build script will copy `public` into the `build` folder.\n    // In `index.html`, you can get URL of `public` folder with %PUBLIC_URL%:\n    // <link rel=\"shortcut icon\" href=\"%PUBLIC_URL%/favicon.ico\">\n    // In JavaScript code, you can access it with `process.env.PUBLIC_URL`.\n    // Note that we only recommend to use `public` folder as an escape hatch\n    // for files like `favicon.ico`, `manifest.json`, and libraries that are\n    // for some reason broken when imported through Webpack. If you just want to\n    // use an image, put it in `src` and `import` it from JavaScript instead.\n    contentBase: paths.appPublic,\n    // By default files from `contentBase` will not trigger a page reload.\n    watchContentBase: true,\n    // Enable hot reloading server. It will provide /sockjs-node/ endpoint\n    // for the WebpackDevServer client so it can learn when the files were\n    // updated. The WebpackDevServer client is included as an entry point\n    // in the Webpack development configuration. Note that only changes\n    // to CSS are currently hot reloaded. JS changes will refresh the browser.\n    hot: true,\n    // It is important to tell WebpackDevServer to use the same \"root\" path\n    // as we specified in the config. In development, we always serve from /.\n    publicPath: config.output.publicPath,\n    // WebpackDevServer is noisy by default so we emit custom message instead\n    // by listening to the compiler events with `compiler.plugin` calls above.\n    quiet: true,\n    // Reportedly, this avoids CPU overload on some systems.\n    // https://github.com/facebookincubator/create-react-app/issues/293\n    // src/node_modules is not ignored to support absolute imports\n    // https://github.com/facebookincubator/create-react-app/issues/1065\n    watchOptions: {\n      ignored: ignoredFiles(paths.appSrc),\n    },\n    // Enable HTTPS if the HTTPS environment variable is set to 'true'\n    https: protocol === 'https',\n    host: host,\n    overlay: false,\n    historyApiFallback: {\n      // Paths with dots should still use the history fallback.\n      // See https://github.com/facebookincubator/create-react-app/issues/387.\n      disableDotRule: true,\n    },\n    public: allowedHost,\n    proxy,\n    before(app) {\n      // This lets us open files from the runtime error overlay.\n      app.use(errorOverlayMiddleware());\n      // This service worker file is effectively a 'no-op' that will reset any\n      // previous service worker registered for the same host:port combination.\n      // We do this in development to avoid hitting the production cache if\n      // it used the same host and port.\n      // https://github.com/facebookincubator/create-react-app/issues/2272#issuecomment-302832432\n      app.use(noopServiceWorkerMiddleware());\n    },\n  };\n};\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"copycat\",\n  \"version\": \"1.0.5\",\n  \"private\": false,\n  \"dependencies\": {\n    \"autoprefixer\": \"7.1.6\",\n    \"babel-core\": \"6.26.0\",\n    \"babel-eslint\": \"7.2.3\",\n    \"babel-jest\": \"20.0.3\",\n    \"babel-loader\": \"7.1.2\",\n    \"babel-preset-react-app\": \"^3.1.1\",\n    \"babel-runtime\": \"6.26.0\",\n    \"case-sensitive-paths-webpack-plugin\": \"2.1.1\",\n    \"chalk\": \"1.1.3\",\n    \"css-loader\": \"0.28.7\",\n    \"dotenv\": \"4.0.0\",\n    \"dotenv-expand\": \"4.2.0\",\n    \"eslint\": \"^5.16.0\",\n    \"eslint-config-react-app\": \"^2.1.0\",\n    \"eslint-loader\": \"1.9.0\",\n    \"eslint-plugin-flowtype\": \"2.39.1\",\n    \"eslint-plugin-import\": \"2.8.0\",\n    \"eslint-plugin-jsx-a11y\": \"5.1.1\",\n    \"eslint-plugin-react\": \"7.4.0\",\n    \"extract-text-webpack-plugin\": \"3.0.2\",\n    \"file-loader\": \"1.1.5\",\n    \"fs-extra\": \"3.0.1\",\n    \"html-webpack-plugin\": \"2.29.0\",\n    \"jest\": \"20.0.4\",\n    \"js-beautify\": \"^1.10.2\",\n    \"object-assign\": \"4.1.1\",\n    \"postcss-flexbugs-fixes\": \"3.2.0\",\n    \"postcss-loader\": \"2.0.8\",\n    \"promise\": \"8.0.1\",\n    \"raf\": \"3.4.0\",\n    \"react\": \"^16.4.1\",\n    \"react-dev-utils\": \"^5.0.1\",\n    \"react-dom\": \"^16.4.1\",\n    \"react-frame-component\": \"^4.0.0\",\n    \"resolve\": \"1.6.0\",\n    \"style-loader\": \"0.19.0\",\n    \"sw-precache-webpack-plugin\": \"0.11.4\",\n    \"unique-selector\": \"^0.4.1\",\n    \"url-loader\": \"0.6.2\",\n    \"webpack\": \"3.8.1\",\n    \"webpack-dev-server\": \">=3.1.11\",\n    \"webpack-manifest-plugin\": \"1.3.2\",\n    \"whatwg-fetch\": \"2.0.3\"\n  },\n  \"scripts\": {\n    \"start\": \"node scripts/start.js\",\n    \"build\": \"node scripts/build.js\",\n    \"test\": \"node scripts/test.js --env=jsdom\"\n  },\n  \"jest\": {\n    \"collectCoverageFrom\": [\n      \"src/**/*.{js,jsx,mjs}\"\n    ],\n    \"setupFiles\": [\n      \"<rootDir>/config/polyfills.js\"\n    ],\n    \"testMatch\": [\n      \"<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}\",\n      \"<rootDir>/src/**/?(*.)(spec|test).{js,jsx,mjs}\"\n    ],\n    \"testEnvironment\": \"node\",\n    \"testURL\": \"http://localhost\",\n    \"transform\": {\n      \"^.+\\\\.(js|jsx|mjs)$\": \"<rootDir>/node_modules/babel-jest\",\n      \"^.+\\\\.css$\": \"<rootDir>/config/jest/cssTransform.js\",\n      \"^(?!.*\\\\.(js|jsx|mjs|css|json)$)\": \"<rootDir>/config/jest/fileTransform.js\"\n    },\n    \"transformIgnorePatterns\": [\n      \"[/\\\\\\\\]node_modules[/\\\\\\\\].+\\\\.(js|jsx|mjs)$\"\n    ],\n    \"moduleNameMapper\": {\n      \"^react-native$\": \"react-native-web\"\n    },\n    \"moduleFileExtensions\": [\n      \"web.js\",\n      \"js\",\n      \"json\",\n      \"web.jsx\",\n      \"jsx\",\n      \"node\",\n      \"mjs\"\n    ]\n  },\n  \"babel\": {\n    \"presets\": [\n      \"react-app\"\n    ]\n  },\n  \"eslintConfig\": {\n    \"extends\": \"react-app\"\n  }\n}"
  },
  {
    "path": "public/app/background.js",
    "content": "'use strict';\n// Called when the user clicks on the browser action\nchrome.browserAction.onClicked.addListener(function (tab) {\n   // Send a message to the active tab\n   chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {\n      var activeTab = tabs[0];\n      chrome.tabs.sendMessage(activeTab.id, { \"message\": \"clicked_browser_action\" });\n   });\n});\n\n// Extension successfully installed.\nchrome.runtime.onInstalled.addListener(function () {\n   console.log('The extension has installed.');\n});\n\n// Download promp starter / handler\nchrome.runtime.onMessage.addListener(\n   (request, sender, sendResponse) => {\n      if (request.downloadContent) {\n         let docContent = request.downloadContent;\n         let doc = URL.createObjectURL(new Blob([docContent], { type: 'application/octet-binary' }));\n         chrome.downloads.download({ url: doc, filename: \"test_name.js\", conflictAction: 'overwrite', saveAs: true });\n         sendResponse({text:'Download started!'});\n      }\n   }\n);\n\n// Send messsage to active tab (content.js)\nvar sendMessageToTester = (contextData) => {\n   chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {\n      chrome.tabs.sendMessage(tabs[0].id, { verify: true, data: contextData }, function () { });\n   });\n}\n\n// Context menu click handler\nchrome.contextMenus.onClicked.addListener(sendMessageToTester);\n\n// Context menu parent\nchrome.contextMenus.create({\n   \"title\": \"Copycat - Testing Extension\",\n   \"id\": \"parent\",\n   \"contexts\": [\"all\", \"link\"]\n});\n\n// Context menu verify-text\nchrome.contextMenus.create({\n   \"id\": \"verify-text\",\n   \"parentId\": \"parent\",\n   \"title\": \"Verify Text\",\n   \"contexts\": [\"selection\"]\n});\n\n// Context menu verify-link\nchrome.contextMenus.create({\n   \"id\": \"verify-link\",\n   \"parentId\": \"parent\",\n   \"title\": \"Verify Link\",\n   \"contexts\": [\"link\"]\n});\n\n\n// Context menu verify-dom\nchrome.contextMenus.create({\n   \"id\": \"verify-dom\",\n   \"parentId\": \"parent\",\n   \"title\": \"Verify DOM Element\",\n   \"contexts\": [\"all\"]\n});\n"
  },
  {
    "path": "public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">\n    <meta name=\"theme-color\" content=\"#000000\">\n    <!--\n      manifest.json provides metadata used when your web app is added to the\n      homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\">\n    <link rel=\"shortcut icon\" href=\"%PUBLIC_URL%/favicon.ico\">\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>\n      You need to enable JavaScript to run this app.\n    </noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "public/manifest.json",
    "content": "{\n  \"short_name\": \"Create a test code without writing a line of code.\",\n  \"name\": \"Copycat - Testing Extension\",\n  \"version\": \"1.0.5\",\n  \"manifest_version\": 2,\n  \"icons\": {\n    \"32\": \"icon32.png\",\n    \"64\": \"icon64.png\",\n    \"128\": \"icon128.png\",\n    \"256\": \"icon256.png\",\n    \"512\": \"icon512.png\",\n    \"1024\": \"icon1024.png\"\n  },\n  \"background\": {\n    \"scripts\": [\n      \"app/background.js\"\n    ]\n  },\n  \"permissions\": [\n    \"contextMenus\",\n    \"storage\",\n    \"declarativeContent\",\n    \"activeTab\",\n    \"tabs\",\n    \"contextMenus\",\n    \"downloads\"\n  ],\n  \"browser_action\": {},\n  \"content_scripts\": [\n    {\n      \"matches\": [\n        \"<all_urls>\"\n      ],\n      \"css\": [\n        \"/static/css/app.css\"\n      ],\n      \"js\": [\n        \"/static/js/content.js\"\n      ]\n    }\n  ],\n  \"web_accessible_resources\": [\n    \"/static/css/content.css\"\n  ],\n  \"content_security_policy\": \"script-src 'self' 'sha256-GgRxrVOKNdB4LrRsVPDSbzvfdV4UqglmviH9GoBJ5jk='; object-src 'self'\"\n}"
  },
  {
    "path": "scripts/build.js",
    "content": "'use strict';\n\n// Do this as the first thing so that any code reading it knows the right env.\nprocess.env.BABEL_ENV = 'production';\nprocess.env.NODE_ENV = 'production';\n\n// Makes the script crash on unhandled rejections instead of silently\n// ignoring them. In the future, promise rejections that are not handled will\n// terminate the Node.js process with a non-zero exit code.\nprocess.on('unhandledRejection', err => {\n  throw err;\n});\n\n// Ensure environment variables are read.\nrequire('../config/env');\n\nconst path = require('path');\nconst chalk = require('chalk');\nconst fs = require('fs-extra');\nconst webpack = require('webpack');\nconst config = require('../config/webpack.config.prod');\nconst paths = require('../config/paths');\nconst checkRequiredFiles = require('react-dev-utils/checkRequiredFiles');\nconst formatWebpackMessages = require('react-dev-utils/formatWebpackMessages');\nconst printHostingInstructions = require('react-dev-utils/printHostingInstructions');\nconst FileSizeReporter = require('react-dev-utils/FileSizeReporter');\nconst printBuildError = require('react-dev-utils/printBuildError');\n\nconst measureFileSizesBeforeBuild =\n  FileSizeReporter.measureFileSizesBeforeBuild;\nconst printFileSizesAfterBuild = FileSizeReporter.printFileSizesAfterBuild;\nconst useYarn = fs.existsSync(paths.yarnLockFile);\n\n// These sizes are pretty large. We'll warn for bundles exceeding them.\nconst WARN_AFTER_BUNDLE_GZIP_SIZE = 512 * 1024;\nconst WARN_AFTER_CHUNK_GZIP_SIZE = 1024 * 1024;\n\n// Warn and crash if required files are missing\nif (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {\n  process.exit(1);\n}\n\n// First, read the current file sizes in build directory.\n// This lets us display how much they changed later.\nmeasureFileSizesBeforeBuild(paths.appBuild)\n  .then(previousFileSizes => {\n    // Remove all content but keep the directory so that\n    // if you're in it, you don't end up in Trash\n    fs.emptyDirSync(paths.appBuild);\n    // Merge with the public folder\n    copyPublicFolder();\n    // Start the webpack build\n    return build(previousFileSizes);\n  })\n  .then(\n    ({ stats, previousFileSizes, warnings }) => {\n      if (warnings.length) {\n        console.log(chalk.yellow('Compiled with warnings.\\n'));\n        console.log(warnings.join('\\n\\n'));\n        console.log(\n          '\\nSearch for the ' +\n            chalk.underline(chalk.yellow('keywords')) +\n            ' to learn more about each warning.'\n        );\n        console.log(\n          'To ignore, add ' +\n            chalk.cyan('// eslint-disable-next-line') +\n            ' to the line before.\\n'\n        );\n      } else {\n        console.log(chalk.green('Compiled successfully.\\n'));\n      }\n\n      console.log('File sizes after gzip:\\n');\n      printFileSizesAfterBuild(\n        stats,\n        previousFileSizes,\n        paths.appBuild,\n        WARN_AFTER_BUNDLE_GZIP_SIZE,\n        WARN_AFTER_CHUNK_GZIP_SIZE\n      );\n      console.log();\n\n      const appPackage = require(paths.appPackageJson);\n      const publicUrl = paths.publicUrl;\n      const publicPath = config.output.publicPath;\n      const buildFolder = path.relative(process.cwd(), paths.appBuild);\n      printHostingInstructions(\n        appPackage,\n        publicUrl,\n        publicPath,\n        buildFolder,\n        useYarn\n      );\n    },\n    err => {\n      console.log(chalk.red('Failed to compile.\\n'));\n      printBuildError(err);\n      process.exit(1);\n    }\n  );\n\n// Create the production build and print the deployment instructions.\nfunction build(previousFileSizes) {\n  console.log('Creating an optimized production build...');\n\n  let compiler = webpack(config);\n  return new Promise((resolve, reject) => {\n    compiler.run((err, stats) => {\n      if (err) {\n        return reject(err);\n      }\n      const messages = formatWebpackMessages(stats.toJson({}, true));\n      if (messages.errors.length) {\n        // Only keep the first error. Others are often indicative\n        // of the same problem, but confuse the reader with noise.\n        if (messages.errors.length > 1) {\n          messages.errors.length = 1;\n        }\n        return reject(new Error(messages.errors.join('\\n\\n')));\n      }\n      if (\n        process.env.CI &&\n        (typeof process.env.CI !== 'string' ||\n          process.env.CI.toLowerCase() !== 'false') &&\n        messages.warnings.length\n      ) {\n        console.log(\n          chalk.yellow(\n            '\\nTreating warnings as errors because process.env.CI = true.\\n' +\n              'Most CI servers set it automatically.\\n'\n          )\n        );\n        return reject(new Error(messages.warnings.join('\\n\\n')));\n      }\n      return resolve({\n        stats,\n        previousFileSizes,\n        warnings: messages.warnings,\n      });\n    });\n  });\n}\n\nfunction copyPublicFolder() {\n  fs.copySync(paths.appPublic, paths.appBuild, {\n    dereference: true,\n    filter: file => file !== paths.appHtml,\n  });\n}\n"
  },
  {
    "path": "scripts/start.js",
    "content": "'use strict';\n\n// Do this as the first thing so that any code reading it knows the right env.\nprocess.env.BABEL_ENV = 'development';\nprocess.env.NODE_ENV = 'development';\n\n// Makes the script crash on unhandled rejections instead of silently\n// ignoring them. In the future, promise rejections that are not handled will\n// terminate the Node.js process with a non-zero exit code.\nprocess.on('unhandledRejection', err => {\n  throw err;\n});\n\n// Ensure environment variables are read.\nrequire('../config/env');\n\nconst fs = require('fs');\nconst chalk = require('chalk');\nconst webpack = require('webpack');\nconst WebpackDevServer = require('webpack-dev-server');\nconst clearConsole = require('react-dev-utils/clearConsole');\nconst checkRequiredFiles = require('react-dev-utils/checkRequiredFiles');\nconst {\n  choosePort,\n  createCompiler,\n  prepareProxy,\n  prepareUrls,\n} = require('react-dev-utils/WebpackDevServerUtils');\nconst openBrowser = require('react-dev-utils/openBrowser');\nconst paths = require('../config/paths');\nconst config = require('../config/webpack.config.dev');\nconst createDevServerConfig = require('../config/webpackDevServer.config');\n\nconst useYarn = fs.existsSync(paths.yarnLockFile);\nconst isInteractive = process.stdout.isTTY;\n\n// Warn and crash if required files are missing\nif (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {\n  process.exit(1);\n}\n\n// Tools like Cloud9 rely on this.\nconst DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3000;\nconst HOST = process.env.HOST || '0.0.0.0';\n\nif (process.env.HOST) {\n  console.log(\n    chalk.cyan(\n      `Attempting to bind to HOST environment variable: ${chalk.yellow(\n        chalk.bold(process.env.HOST)\n      )}`\n    )\n  );\n  console.log(\n    `If this was unintentional, check that you haven't mistakenly set it in your shell.`\n  );\n  console.log(`Learn more here: ${chalk.yellow('http://bit.ly/2mwWSwH')}`);\n  console.log();\n}\n\n// We attempt to use the default port but if it is busy, we offer the user to\n// run on a different port. `choosePort()` Promise resolves to the next free port.\nchoosePort(HOST, DEFAULT_PORT)\n  .then(port => {\n    if (port == null) {\n      // We have not found a port.\n      return;\n    }\n    const protocol = process.env.HTTPS === 'true' ? 'https' : 'http';\n    const appName = require(paths.appPackageJson).name;\n    const urls = prepareUrls(protocol, HOST, port);\n    // Create a webpack compiler that is configured with custom messages.\n    const compiler = createCompiler(webpack, config, appName, urls, useYarn);\n    // Load proxy config\n    const proxySetting = require(paths.appPackageJson).proxy;\n    const proxyConfig = prepareProxy(proxySetting, paths.appPublic);\n    // Serve webpack assets generated by the compiler over a web sever.\n    const serverConfig = createDevServerConfig(\n      proxyConfig,\n      urls.lanUrlForConfig\n    );\n    const devServer = new WebpackDevServer(compiler, serverConfig);\n    // Launch WebpackDevServer.\n    devServer.listen(port, HOST, err => {\n      if (err) {\n        return console.log(err);\n      }\n      if (isInteractive) {\n        clearConsole();\n      }\n      console.log(chalk.cyan('Starting the development server...\\n'));\n      openBrowser(urls.localUrlForBrowser);\n    });\n\n    ['SIGINT', 'SIGTERM'].forEach(function(sig) {\n      process.on(sig, function() {\n        devServer.close();\n        process.exit();\n      });\n    });\n  })\n  .catch(err => {\n    if (err && err.message) {\n      console.log(err.message);\n    }\n    process.exit(1);\n  });\n"
  },
  {
    "path": "scripts/test.js",
    "content": "'use strict';\n\n// Do this as the first thing so that any code reading it knows the right env.\nprocess.env.BABEL_ENV = 'test';\nprocess.env.NODE_ENV = 'test';\nprocess.env.PUBLIC_URL = '';\n\n// Makes the script crash on unhandled rejections instead of silently\n// ignoring them. In the future, promise rejections that are not handled will\n// terminate the Node.js process with a non-zero exit code.\nprocess.on('unhandledRejection', err => {\n  throw err;\n});\n\n// Ensure environment variables are read.\nrequire('../config/env');\n\nconst jest = require('jest');\nlet argv = process.argv.slice(2);\n\n// Watch unless on CI or in coverage mode\nif (!process.env.CI && argv.indexOf('--coverage') < 0) {\n  argv.push('--watch');\n}\n\n\njest.run(argv);\n"
  },
  {
    "path": "src/App.js",
    "content": "import React, { Component } from 'react';\n\nclass App extends Component {\n  render() {\n    return (\n      <div className=\"App\">\n        <header className=\"App-header\">\n          <h1 className=\"App-title\">Welcome to React</h1>\n        </header>\n        <p className=\"App-intro\">\n          To get started, edit <code>src/App.js</code> and save to reload.\n        </p>\n      </div>\n    );\n  }\n}\n\nexport default App;\n"
  },
  {
    "path": "src/Commands.js",
    "content": "import React, { Component } from 'react'\nimport { eventColors } from './Constants';\n\nexport default class Commands extends Component {\n\n  _commandsHandler() {\n    var commands = [];\n    for (var key in this.props.commands) {\n      var event = this.props.commands[key];\n      if (event) {\n        commands.push(\n          <div className=\"app-action\" style={{\n            backgroundColor: eventColors[event.type]\n          }}>\n            <div className=\"app-action-type\">{event.type.toUpperCase()}</div>\n            <div className=\"app-action-target\">{event.selector}</div>\n            {event.data && event.data.key ? <div className=\"app-action-info\">{event.data.key}</div> : ''}\n            {event.data && event.data.mousePos && event.data.mouseTarget ? <div className=\"app-action-info\">{'(' + event.data.mousePos.x + ',' + event.data.mousePos.y + ') to (' + event.data.mouseTarget.x + ',' + event.data.mouseTarget.y + ')'}</div> : ''}\n            <button\n              id={key}\n              className=\"app-action-remove\"\n              onClick={(e) => {\n                this.props.remove(e.target.id);\n              }}>x</button>\n          </div>\n        )\n      }\n    }\n\n    return (\n\n      <div>\n        {commands.reverse()}\n      </div>\n\n    )\n\n  }\n\n  render() {\n\n    return (\n\n      <div className={\"app-actions\"}>\n        {this._commandsHandler()}\n      </div>\n\n    )\n  }\n}\n"
  },
  {
    "path": "src/Constants.js",
    "content": "// Keys which are not characters\nexport const keyCommands = [\n    \"Enter\",\n    \"Backspace\",\n    \"Tab\",\n    \"Meta\",\n    \"Escape\",\n    \"Alt\",\n    \"Control\",\n    \"Shift\",\n    \"CapsLock\"\n];\n\n// Keys which can be combined\nexport const combinationKeys = [\n    \"Meta\",\n    \"Alt\",\n    \"Control\",\n    \"Shift\"\n];\n\n// The events which will be recorded\nexport const captureEvents = [\n    \"keydown\",\n    \"mousedown\",\n    \"mouseup\"\n];\n\n// Unique selector configuration\nexport const selectorOptions = {\n    selectorTypes: [\n        \"ID\",\n        \"Class\",\n        \"Tag\",\n        \"NthChild\"\n    ]\n};\n\n// Command box colors according to the action\nexport const eventColors = {\n    \"mousedown\": \"#fff0fe\",\n    \"click\": \"#f0f4ff\",\n    \"drag-and-drop\": \"#f0feff\",\n    \"keydown\": \"#f2fff0\",\n    \"combined-keydown\": \"#fffce4\",\n    \"verify-text\": \"#ffebe7\",\n    \"verify-link\": \"#fdeff9\",\n    \"verify-dom\": \"#f1f1f1\",\n    \"page-change\": \"rgba(144, 121, 212, 0.15)\",\n    \"click-page-change\": \"#d7ffdc\"\n}\n\n// Chrome.storage key\nexport const storageKey = \"commands\";"
  },
  {
    "path": "src/Generator.js",
    "content": "import { keyCommands } from './Constants';\n\nclass Generator {\n\n    constructor() {\n        this.code = \"\";\n    }\n\n    get rules() {\n        return {\n            beforeAll: [\n                `await page.goto('${this.initURL}');`\n            ]\n        }\n    }\n\n    addRulesInner(rules) {\n        rules.forEach(rule => {\n            this.code += rule;\n        });\n    }\n\n    addRules() {\n        for (var key in this.rules) {\n            var rules = this.rules[key];\n            switch (key) {\n                case 'beforeAll':\n                    this.code += `beforeAll(async () => {`;\n                    this.addRulesInner(rules);\n                    this.code += `});`;\n                    break;\n                case 'afterAll':\n                    this.code += `afterAll(async () => {`;\n                    this.addRulesInner(rules);\n                    this.code += `});`;\n                    break;\n                case 'beforeEach':\n                    this.code += `beforeEach(async () => {`;\n                    this.addRulesInner(rules);\n                    this.code += `};`;\n                    break;\n            }\n        }\n    }\n\n    addCommand(command) {\n        if (command && command.type) {\n            switch (command.type) {\n                case 'click':\n                    this.code += `await page.click('${command.selector}');`;\n                    break;\n                case 'keydown':\n                    if (keyCommands.includes(command.data.key)) {\n                        this.code += `await page.keyboard.press('${command.data.key}');`;\n                    } else {\n                        this.code += `await page.type('${command.selector}', '${command.data.key}');`\n                    }\n                    break;\n                case 'verify-text':\n                    this.code += `var textContent = await page.$$eval('${command.selector}', el => el[0].textContent);`;\n                    this.code += `var finalTextContent = textContent.trim();`;\n                    this.code += `expect(finalTextContent).toBe('${command.data.key}');`;\n                    break;\n                case 'verify-dom':\n                    this.code += `var elCount = await page.$$eval('${command.selector}', el => el.length);`;\n                    this.code += `expect(elCount).toBeGreaterThan(0);`;\n                    break;\n                case 'verify-link':\n                    this.code += `var nodeLink = await page.$$eval('${command.selector}', el => el[0].href);`;\n                    this.code += `expect(nodeLink).toBe('${command.data.key}');`;\n                    break;\n                case 'page-change':\n                    this.code += `await page.waitForNavigation({ waitUntil: 'load' });`\n                    break;\n                case 'click-page-change':\n                    this.code += `await Promise.all([`;\n                    this.code += `page.click('${command.selector}'),`;\n                    this.code += `page.waitForNavigation()]);`;\n                    break;\n                case 'combined-keydown':\n                    command.data.commands.forEach(com => {\n                        this.code += `await page.keyboard.down('${com}');`\n                    });\n                    this.code += `await page.keyboard.press('${command.data.key.slice(-1)}');`;\n                    command.data.commands.forEach(com => {\n                        this.code += `await page.keyboard.up('${com}');`\n                    });\n                    break;\n                case 'drag-and-drop':\n                    this.code += `await page.mouse.move(${command.data.mousePos.x},${command.data.mousePos.y});`;\n                    this.code += `await page.mouse.down();`;\n                    this.code += `await page.mouse.move(${command.data.mouseTarget.x},${command.data.mouseTarget.y});`;\n                    this.code += `await page.mouse.up();`;\n                    break;\n            }\n        }\n    }\n\n    addIt(description, commands) {\n        this.code += `it('${description}', async () => {`;\n        commands.forEach(command => {\n            this.addCommand(command);\n        });\n        this.code += `}, 60000);`;\n    }\n\n    addDescription(description, commands) {\n        this.code += `describe('${description}', () => {`;\n        this.addRules();\n        this.addIt('Test 1 - 1', commands);\n        this.code += `});`;\n    }\n\n\n    generatePuppeteerCode(commands, initURL) {\n        this.initURL = initURL;\n        this.addDescription(\"Test 1\", commands);\n        return this.code;\n    }\n}\n\nexport default Generator;"
  },
  {
    "path": "src/content.js",
    "content": "/*global chrome*/\n/* src/content.js */\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport unique from 'unique-selector';\nimport beautify from 'js-beautify';\n\nimport { keyCommands, captureEvents, selectorOptions, storageKey, combinationKeys } from './Constants';\nimport Generator from './Generator';\nimport Commands from './Commands';\n\nconst app = document.createElement('div');\napp.id = \"testing-extension\";\n\nclass Main extends React.Component {\n\n  constructor(props) {\n    // Inheritance\n    super(props);\n\n    // Method bindings\n    this.verify = this.verify.bind(this);\n    this.prepareToAddStorage = this.prepareToAddStorage.bind(this);\n\n    // Initial state definition\n    this.state = {\n      step: 1,\n      paused: false,\n      copied: false,\n    };\n\n    // Message listener for \"verify-*\" events\n    chrome.runtime.onMessage.addListener(\n      (request, sender, sendResponse) => {\n        if (request.verify) {\n          this.verify(request.data)\n        }\n      }\n    );\n  }\n\n  componentDidMount = () => {\n    // Extension toggle handler\n    chrome.storage.sync.get(['toggle', 'paused'], function (res) {\n      app.style.display = res.toggle;\n      if (res.toggle === 'block') {\n        document.body.className += \" toggle\";\n      } else {\n        document.body.className = document.body.className.replace(\"toggle\", \"\").trim();\n      }\n    });\n\n    // Extension \"puased\" state updater\n    let self = this;\n    chrome.storage.sync.get('paused', function (res) {\n      self.setState({\n        paused: res.paused\n      })\n    });\n\n    // Extension \"recording\" state handler\n    chrome.storage.sync.get('recording', function (res) {\n      switch (res.recording) {\n        case 1:\n          self.resetHandler();\n          break;\n        case 2:\n          if (self.state.paused) {\n            self.pauseHandler();\n          } else {\n            self.recordHandler();\n          }\n          break;\n        case 3:\n          self.stopHandler();\n          break;\n        default:\n          self.resetHandler();\n          break;\n      }\n    });\n\n    // STORAGE (HISTORY)\n    chrome.storage.sync.get([storageKey], function (result) {\n      var storeArray = result[storageKey] ? result[storageKey] : [];\n      self.setState({ storeArray });\n    });\n  }\n\n  // Sends message to background.js\n  sendMessageToBackground = (msg) => {\n    chrome.runtime.sendMessage({ downloadContent: msg }, function (response) {\n      return;\n    });\n  }\n\n  // Handling \"verify-*\" actions\n  verify(data) {\n    let selection = document.getSelection();\n    let node = selection.baseNode.parentNode;\n    let newEntry;\n    switch (data.menuItemId) {\n      case \"verify-text\":\n        newEntry = {\n          type: data.menuItemId,\n          selector: unique(node, selectorOptions),\n          data: {\n            key: selection.baseNode.textContent\n          }\n        };\n        break;\n      case \"verify-dom\":\n        newEntry = {\n          type: data.menuItemId,\n          selector: unique(node, selectorOptions),\n          data: \"\"\n        };\n        break;\n      case \"verify-link\":\n        newEntry = {\n          type: data.menuItemId,\n          selector: unique(node, selectorOptions),\n          data: {\n            key: data.linkUrl\n          }\n        };\n        break;\n      default:\n        // if the action is \"verify\" but not defined, it logs to the console WTF!\n        console.log(\"WTF!\")\n        return;\n    }\n    this.addToStorage(newEntry);\n  }\n\n  // Is \"#element\" is in \"el\"\n  isRecursivelyInId(el, id) {\n    if (el.id === id) return true;\n\n    while (el.parentNode) {\n      el = el.parentNode;\n      if (el.id === id) {\n        return true;\n      }\n    }\n    return false;\n  }\n\n  // .length  without nulls\n  calculateStoreLengthWithoutNulls = () => {\n    let l = 0;\n    this.state.storeArray.forEach(element => {\n      if (element) {\n        l++;\n      }\n    });\n    return l;\n  }\n\n  // Distance of 2 coordinates\n  distance = (a, b) => {\n    return Math.sqrt(Math.pow((a.x - b.x), 2) + Math.pow((a.y - b.y), 2))\n  }\n\n  // Adding prepared actions to state and store\n  addToStorage = (entry) => {\n    let self = this;\n    chrome.storage.sync.get(storageKey, function (result) {\n      var storeArray = result[storageKey] ? result[storageKey] : {};\n      let id = Object.keys(storeArray).length\n\n      let keyCheckObject = storeArray[id - 1];\n\n      if (keyCheckObject) {\n\n        switch (keyCheckObject.type) {\n\n          case 'mousedown':\n\n            if (entry.type === 'mouseup') {\n              let r = self.distance(entry.data.mousePos, keyCheckObject.data.mousePos);\n              if (r > 10) {\n                keyCheckObject.type = 'drag-and-drop'\n                keyCheckObject.data.mouseTarget = { x: entry.data.mousePos.x, y: entry.data.mousePos.y };\n              } else {\n                keyCheckObject.type = 'click';\n              }\n            }\n            else if (entry.type === 'page-change') {\n              keyCheckObject.type = 'click-page-change';\n            }\n            else if (entry.type === 'mousedown') {\n              keyCheckObject.type = 'click';\n              storeArray[id + 1] = entry;\n            }\n            else {\n              keyCheckObject.type = entry.type;\n              keyCheckObject.data = entry.data;\n              keyCheckObject.selector = entry.selector;\n            }\n            break;\n\n          case 'mouseup':\n\n            storeArray[id] = entry;\n            storeArray[id].type = 'click';\n            break;\n\n          case 'click':\n\n            if (entry.type === 'page-change') {\n              keyCheckObject.type = 'click-page-change';\n            } else if (entry.type === 'mouseup') {\n              storeArray[id] = entry;\n              storeArray[id].type = 'click';\n            } else {\n              storeArray[id] = entry;\n            }\n            break;\n\n          case 'keydown':\n\n            if (!keyCommands.includes(keyCheckObject.data.key) && keyCheckObject.selector === entry.selector && !keyCommands.includes(entry.data.key)) {\n              keyCheckObject.data.key += entry.data.key;\n            } else if (combinationKeys.includes(keyCheckObject.data.key) && keyCheckObject.selector === entry.selector && entry.data.commands && !combinationKeys.includes(entry.data.key)) {\n              entry.data.commands.forEach(command => {\n                keyCheckObject.type = 'combined-keydown';\n                keyCheckObject.data.key += '+' + entry.data.key.toUpperCase();\n              });\n            } else if (entry.type === 'mouseup') {\n              storeArray[id] = entry;\n              storeArray[id].type = 'click';\n            } else {\n              storeArray[id] = entry;\n            }\n            break;\n\n          default:\n\n            storeArray[id] = entry;\n            break;\n        }\n      } else {\n\n        storeArray[id] = entry;\n      }\n\n      var jsonObj = {};\n\n      if (id === 0) {\n        jsonObj['initURL'] = document.URL;\n      }\n      jsonObj[storageKey] = storeArray;\n\n      // update the state\n      self.setState({ storeArray });\n\n      // update the store\n      chrome.storage.sync.set(jsonObj, function () {\n        return\n      });\n    });\n  }\n\n  // Prepare actions before adding them to state and store\n  prepareToAddStorage(e) {\n    if (!this.isRecursivelyInId(e.target, 'testing-extension')) {\n      let commands = [];\n      if (e.ctrlKey) commands.push('Ctrl');\n      if (e.metaKey) commands.push('Meta');\n      if (e.altKey) commands.push('Alt');\n      if (e.shiftKey) commands.push('Shift');\n\n      let code = e.key ? e.key : ''\n      let mousePos = e.pageX ? { x: e.pageX, y: e.pageY } : ''\n      let selector = unique(e.target, selectorOptions);\n\n      let newEntry = {\n        type: e.type,\n        selector: selector,\n        data: {\n          key: code,\n          mousePos,\n          commands\n        }\n      };\n\n      setTimeout(() => {\n        this.addToStorage(newEntry);\n      }, 100);\n    }\n\n  }\n\n  // Remove specific action from state and store\n  remove = (id) => {\n    let self = this;\n    chrome.storage.sync.get(storageKey, function (result) {\n      var storeArray = result[storageKey] ? result[storageKey] : {};\n\n      delete storeArray[id];\n\n      var jsonObj = {};\n      jsonObj[storageKey] = storeArray;\n\n      // uptade the state\n      self.setState({ storeArray })\n\n      chrome.storage.sync.set(jsonObj, function () {\n        return;\n      });\n    });\n  }\n\n  // Start recording\n  record = () => {\n    captureEvents.forEach(event => {\n      window.addEventListener(event, this.prepareToAddStorage)\n    });\n\n    // Special case \"page-change\" event handler\n    window.onbeforeunload = (e) => {\n      let newEntry = {\n        type: 'page-change',\n        selector: undefined,\n        data: undefined\n      };\n      setTimeout(() => this.addToStorage(newEntry), 105);\n      // this.addToStorage(newEntry);\n    }\n    this.setState({ paused: false });\n  }\n\n  // Stop recording\n  stop = () => {\n    window.onbeforeunload = null;\n    captureEvents.forEach(event => {\n      window.removeEventListener(event, this.prepareToAddStorage)\n    });\n  }\n\n  // Reset state and the store\n  reset = () => {\n    this.setState({ storeArray: [], copied: false }, () => {\n      var jsonObj = {};\n      jsonObj[storageKey] = [];\n      chrome.storage.sync.set(jsonObj, function () {\n        return;\n      });\n    })\n  }\n\n  // Map actions to jest-puppeteer code and call download prompt method (in background.js)\n  save = () => {\n    let initURL = '';\n    chrome.storage.sync.get('initURL', (res) => {\n      initURL = res.initURL;\n    })\n    let self = this;\n    chrome.storage.sync.get([storageKey], function (result) {\n      var storeArray = result[storageKey] ? result[storageKey] : [];\n      var gen = new Generator();\n      let code = gen.generatePuppeteerCode(storeArray, initURL);\n      let beautifiedCode = beautify(code, { indent_size: 2, space_in_empty_paren: true });\n      self.sendMessageToBackground(beautifiedCode);\n    });\n  }\n\n  copy = () => {\n    let initURL = '';\n    chrome.storage.sync.get('initURL', (res) => {\n      initURL = res.initURL;\n    })\n    let self = this;\n    chrome.storage.sync.get([storageKey], function (result) {\n      var storeArray = result[storageKey] ? result[storageKey] : [];\n      var gen = new Generator();\n      let code = gen.generatePuppeteerCode(storeArray, initURL);\n      let beautifiedCode = beautify(code, { indent_size: 2, space_in_empty_paren: true });\n\n      const tempInput = document.createElement(\"textarea\");\n      tempInput.value = beautifiedCode;\n      document.body.appendChild(tempInput);\n      tempInput.select();\n      document.execCommand(\"copy\");\n      document.body.removeChild(tempInput);\n\n      self.setState({ copied: true })\n    });\n  }\n\n  // Record button handler\n  recordHandler = () => {\n    this.record();\n    this.storeRecordingState(2);\n  }\n\n  // Stop button handler\n  stopHandler = () => {\n    this.stop();\n    this.storeRecordingState(3);\n  }\n\n  // Resume button handler\n  resumeHandler = () => {\n    this.record();\n    this.storePausedState(false);\n    this.storeRecordingState(2);\n  }\n\n  // Pause button handler\n  pauseHandler = () => {\n    this.stop();\n    this.storePausedState(true);\n    this.storeRecordingState(2);\n  }\n\n  // Reset button handler\n  resetHandler = () => {\n    this.reset();\n    this.storeRecordingState(1);\n  }\n\n  // Save recording state\n  storeRecordingState = (recordingState) => {\n    let self = this;\n    chrome.storage.sync.set({ recording: recordingState }, () => {\n      self.setState({ step: recordingState });\n    })\n  }\n\n  // Save recording state\n  storePausedState = (paused) => {\n    let self = this;\n    chrome.storage.sync.set({ paused }, () => {\n      self.setState({ paused });\n    })\n  }\n\n  // Render the DOM\n  render() {\n    return (\n      <div className={'my-extension'}>\n        <div className={`app app-step-${this.state.step}`}>\n          <div className=\"app-controls\">\n            <div className=\"app-action-step-1\">\n              <h3 className=\"app-title\">Not Recording</h3>\n              <div className=\"app-buttons\">\n                <button onClick={this.recordHandler} className=\"app-record-button\">Record</button>\n              </div>\n              <h6 className=\"app-subtitle pulse\">Click \"Record\" to start recording...</h6>\n            </div>\n            <div className=\"app-action-step-2\">\n              <h3 className=\"app-subtitle\">{this.state.paused ? 'Paused' : <span className=\"app-subtitle-recording\">Recording</span>}</h3>\n              <h2 className=\"app-title\">{this.state.storeArray ? this.calculateStoreLengthWithoutNulls() : 0} Actions</h2>\n              <div className=\"app-buttons\">\n                {this.state.paused ?\n                  <button onClick={this.resumeHandler} className=\"app-ghost-button for-resume\">\n                    Resume\n                  </button>\n                  :\n                  <button onClick={this.pauseHandler} className=\"app-ghost-button for-pause\">\n                    Pause\n                  </button>\n                }\n                <button onClick={this.stopHandler} className=\"app-ghost-button for-stop\">\n                  Stop\n                </button>\n              </div>\n            </div>\n            <div className=\"app-action-step-3\">\n              <h3 className=\"app-subtitle\">Done!</h3>\n              <h2 className=\"app-title\">{this.state.storeArray ? this.calculateStoreLengthWithoutNulls() : 0} Actions</h2>\n              <div className=\"app-buttons\">\n                <button onClick={this.resetHandler} className=\"app-ghost-button for-reset\">\n                  Reset\n                </button>\n                <button onClick={this.save} className=\"app-ghost-button for-save\">\n                  Save\n                </button>\n                <button onClick={this.copy} className=\"app-ghost-button for-copy\">\n                  {this.state.copied ? 'Copied!' : 'Copy'}\n                </button>\n              </div>\n            </div>\n          </div>\n          {this.state.storeArray ? <Commands remove={this.remove} btnClickHndlr={this.buttonClickHandler} commands={this.state.storeArray} /> : ''}\n        </div>\n      </div>\n    )\n  }\n}\n\n// Add extension to the page\ndocument.body.appendChild(app);\nReactDOM.render(<Main />, app);\n\n// Toggle listener (Extension icon click handler)\nchrome.runtime.onMessage.addListener(\n  function (request, sender, sendResponse) {\n    if (request.message === \"clicked_browser_action\") {\n      toggle();\n    }\n  }\n);\n\n// Toggle handler \nfunction toggle() {\n  if (app.style.display === \"none\") {\n    chrome.storage.sync.set({ toggle: 'block' }, function () {\n\n      app.style.display = \"block\";\n      document.body.className += \" toggle\";\n    });\n  } else {\n    chrome.storage.sync.set({ toggle: 'none' }, function () {\n\n      app.style.display = \"none\";\n      document.body.className = document.body.className.replace(\"toggle\", \"\").trim();\n    });\n  }\n}"
  },
  {
    "path": "src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './style.css';\nimport App from './App';\nimport registerServiceWorker from './registerServiceWorker';\n\nReactDOM.render(<App />, document.getElementById('root'));\nregisterServiceWorker();\n"
  },
  {
    "path": "src/registerServiceWorker.js",
    "content": "// In production, we register a service worker to serve assets from local cache.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on the \"N+1\" visit to a page, since previously\n// cached resources are updated in the background.\n\n// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.\n// This link also includes instructions on opting out of this behavior.\n\nconst isLocalhost = Boolean(\n  window.location.hostname === 'localhost' ||\n    // [::1] is the IPv6 localhost address.\n    window.location.hostname === '[::1]' ||\n    // 127.0.0.1/8 is considered localhost for IPv4.\n    window.location.hostname.match(\n      /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n    )\n);\n\nexport default function register() {\n  if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n    // The URL constructor is available in all browsers that support SW.\n    const publicUrl = new URL(process.env.PUBLIC_URL, window.location);\n    if (publicUrl.origin !== window.location.origin) {\n      // Our service worker won't work if PUBLIC_URL is on a different origin\n      // from what our page is served on. This might happen if a CDN is used to\n      // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374\n      return;\n    }\n\n    window.addEventListener('load', () => {\n      const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n      if (isLocalhost) {\n        // This is running on localhost. Lets check if a service worker still exists or not.\n        checkValidServiceWorker(swUrl);\n\n        // Add some additional logging to localhost, pointing developers to the\n        // service worker/PWA documentation.\n        navigator.serviceWorker.ready.then(() => {\n          console.log(\n            'This web app is being served cache-first by a service ' +\n              'worker. To learn more, visit https://goo.gl/SC7cgQ'\n          );\n        });\n      } else {\n        // Is not local host. Just register service worker\n        registerValidSW(swUrl);\n      }\n    });\n  }\n}\n\nfunction registerValidSW(swUrl) {\n  navigator.serviceWorker\n    .register(swUrl)\n    .then(registration => {\n      registration.onupdatefound = () => {\n        const installingWorker = registration.installing;\n        installingWorker.onstatechange = () => {\n          if (installingWorker.state === 'installed') {\n            if (navigator.serviceWorker.controller) {\n              // At this point, the old content will have been purged and\n              // the fresh content will have been added to the cache.\n              // It's the perfect time to display a \"New content is\n              // available; please refresh.\" message in your web app.\n              console.log('New content is available; please refresh.');\n            } else {\n              // At this point, everything has been precached.\n              // It's the perfect time to display a\n              // \"Content is cached for offline use.\" message.\n              console.log('Content is cached for offline use.');\n            }\n          }\n        };\n      };\n    })\n    .catch(error => {\n      console.error('Error during service worker registration:', error);\n    });\n}\n\nfunction checkValidServiceWorker(swUrl) {\n  // Check if the service worker can be found. If it can't reload the page.\n  fetch(swUrl)\n    .then(response => {\n      // Ensure service worker exists, and that we really are getting a JS file.\n      if (\n        response.status === 404 ||\n        response.headers.get('content-type').indexOf('javascript') === -1\n      ) {\n        // No service worker found. Probably a different app. Reload the page.\n        navigator.serviceWorker.ready.then(registration => {\n          registration.unregister().then(() => {\n            window.location.reload();\n          });\n        });\n      } else {\n        // Service worker found. Proceed as normal.\n        registerValidSW(swUrl);\n      }\n    })\n    .catch(() => {\n      console.log(\n        'No internet connection found. App is running in offline mode.'\n      );\n    });\n}\n\nexport function unregister() {\n  if ('serviceWorker' in navigator) {\n    navigator.serviceWorker.ready.then(registration => {\n      registration.unregister();\n    });\n  }\n}\n"
  },
  {
    "path": "src/style.css",
    "content": "@import url(\"https://fonts.googleapis.com/css?family=DM+Sans:400,500,700&display=swap\");\n\n.toggle {\n  padding-right: 400px;\n}\n\n#testing-extension {\n  position: fixed;\n  top: 0;\n  right: 0;\n  width: 400px;\n  background-color: #fff;\n  z-index: 999999999 !important;\n  border-left: 1px solid #ddd;\n  box-shadow: -4px 10px 10px rgba(0, 0, 0, 0.2);\n  height: 100vh;\n}\n\n#testing-extension .app {\n  width: 400px;\n  height: 100vh;\n  padding: 20px;\n  box-sizing: border-box;\n}\n\n#testing-extension .app * {\n  all: unset;\n  box-sizing: border-box;\n  font-family: \"DM Sans\", sans-serif;\n  line-height: 1;\n}\n\n#testing-extension .app-controls {\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: center;\n  flex-direction: column;\n  transition: 0.3s;\n}\n\n#testing-extension .app-controls>* {\n  width: 100%;\n}\n\n#testing-extension .app-title {\n  font-size: 24px;\n  display: block;\n  text-align: center;\n  font-weight: 500;\n  margin-bottom: 16px;\n}\n\n#testing-extension .app-record-button {\n  padding: 10px 10px 10px 30px;\n  align-self: center;\n  color: #fff;\n  background-color: #07b94b;\n  cursor: pointer;\n  border-radius: 4px;\n  position: relative;\n}\n\n#testing-extension .app-record-button:before {\n  content: \"\";\n  position: absolute;\n  left: 10px;\n  top: 50%;\n  -webkit-transform: translateY(-50%);\n  transform: translateY(-50%);\n  width: 10px;\n  height: 10px;\n  border-radius: 50%;\n  background-color: #fff;\n}\n\n#testing-extension .app-subtitle-recording {\n  position: relative;\n}\n\n#testing-extension .app-subtitle-recording:before {\n  content: \"\";\n  position: absolute;\n  left: -14px;\n  top: 3px;\n  width: 10px;\n  height: 10px;\n  border-radius: 50%;\n  background-color: red;\n  -webkit-animation-name: app-pulse;\n  animation-name: app-pulse;\n  -webkit-animation-duration: 1s;\n  animation-duration: 1s;\n  -webkit-animation-iteration-count: infinite;\n  animation-iteration-count: infinite;\n}\n\n#testing-extension .app-actions {\n  display: flex;\n  flex-direction: column;\n  overflow: auto;\n  height: calc(100vh - 170px);\n}\n\n#testing-extension .app-action {\n  display: flex;\n  flex-direction: column;\n  padding: 20px;\n  border-radius: 4px;\n  border: 1px solid rgba(0, 0, 0, 0.1);\n  background-color: #f4f4f4;\n  position: relative;\n  margin-bottom: 4px;\n}\n\n#testing-extension .app-action+#testing-extension .app-action {\n  margin-top: 14px;\n}\n\n#testing-extension .app-action-type {\n  align-self: flex-start;\n  padding: 6px;\n  background-color: rgba(0, 0, 0, 0.1);\n  margin-bottom: 12px;\n  font-weight: 500;\n  font-size: 13px;\n  letter-spacing: 2px;\n  border-radius: 4px;\n}\n\n#testing-extension .app-action-target {\n  font-family: monospace;\n}\n\n#testing-extension .app-action-info {\n  font-size: 14px;\n  line-height: 1.4;\n  background-color: #fff;\n  margin-top: 12px;\n  padding: 12px;\n  border-radius: 4px;\n  border: 1px solid rgba(0, 0, 0, 0.1);\n}\n\n#testing-extension .app-action-remove {\n  position: absolute;\n  top: 0;\n  opacity: 0;\n  visibility: hidden;\n  transition: 0.3s;\n  right: 0;\n  width: 25px;\n  height: 25px;\n  cursor: pointer;\n  border: 0;\n  background: 0;\n  padding: 0;\n  background-repeat: no-repeat;\n  background-size: 10px;\n  border-radius: 0 0 0 6px;\n  background-position: center;\n  background-color: rgba(0, 0, 0, 0.1);\n  background-image: url(\"data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 212.982 212.982'%3e%3cpath d='M131.804 106.491l75.936-75.936c6.99-6.99 6.99-18.323 0-25.312-6.99-6.99-18.322-6.99-25.312 0L106.491 81.18 30.554 5.242c-6.99-6.99-18.322-6.99-25.312 0-6.989 6.99-6.989 18.323 0 25.312l75.937 75.936-75.937 75.937c-6.989 6.99-6.989 18.323 0 25.312 6.99 6.99 18.322 6.99 25.312 0l75.937-75.937 75.937 75.937c6.989 6.99 18.322 6.99 25.312 0 6.99-6.99 6.99-18.322 0-25.312l-75.936-75.936z' fill-rule='evenodd' clip-rule='evenodd'/%3e%3c/svg%3e\");\n  color: transparent;\n}\n\n#testing-extension .app-action-remove:hover {\n  background-color: rgba(0, 0, 0, 0.2);\n}\n\n#testing-extension .app-action:hover .app-action-remove {\n  opacity: 1;\n  visibility: visible;\n}\n\n#testing-extension .app-subtitle {\n  margin-bottom: 6px;\n  color: rgba(0, 0, 0, 0.5);\n  font-size: 15px;\n  text-align: center;\n  display: block;\n  width: 100%;\n}\n\n#testing-extension .app-buttons {\n  display: flex;\n  justify-content: center;\n  text-align: center;\n  margin-bottom: 20px;\n}\n\n#testing-extension .app-ghost-button {\n  margin: 0 5px;\n  display: inline-block;\n  border-radius: 4px;\n  padding: 10px 10px 10px 30px;\n  background-position: left;\n  color: #fff;\n  cursor: pointer;\n  background-size: 14px;\n  background-repeat: no-repeat;\n  background-position: 10px 50%;\n}\n\n#testing-extension .app-ghost-button.for-pause {\n  background-color: orange;\n  background-image: url(\"data:image/svg+xml;charset=UTF-8,%3csvg fill='white' xmlns='http://www.w3.org/2000/svg' width='45.975' height='45.975'%3e%3cpath d='M13.987 0a5 5 0 0 0-5 5v35.975c0 2.763 2.238 5 5 5s5-2.238 5-5V5c0-2.762-2.237-5-5-5zM31.987 0a5 5 0 0 0-5 5v35.975c0 2.762 2.238 5 5 5s5-2.238 5-5V5a5 5 0 0 0-5-5z'/%3e%3c/svg%3e\");\n}\n\n#testing-extension .app-ghost-button.for-resume {\n  background-color: #07b94b;\n  background-image: url(\"data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath d='M 8 5.5 C 7.172 5.5 6.5 6.172 6.5 7 L 6.5 22 C 6.5 22.828 7.172 23.5 8 23.5 C 8.828 23.5 9.5 22.828 9.5 22 L 9.5 7 C 9.5 6.172 8.828 5.5 8 5.5 z M 13.5 5.5 A 1 1 0 0 0 12.5 6.5 A 1 1 0 0 0 12.5 6.5039062 L 12.5 14.5 L 12.5 22.496094 A 1 1 0 0 0 12.5 22.5 A 1 1 0 0 0 13.5 23.5 A 1 1 0 0 0 14.091797 23.304688 L 14.09375 23.304688 A 1 1 0 0 0 14.121094 23.283203 L 25.041016 15.341797 A 1 1 0 0 0 25.5 14.5 A 1 1 0 0 0 25.056641 13.669922 L 14.09375 5.6953125 A 1 1 0 0 0 13.5 5.5 z' fill='%23fff'%3e%3c/path%3e%3c/svg%3e\");\n}\n\n#testing-extension .app-ghost-button.for-stop {\n  background-color: #d40000;\n  background-image: url(\"data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 491.858 491.858'%3e%3cpath d='M491.858 475.862c0 8.833-7.162 15.996-15.996 15.996H15.996C7.16 491.858 0 484.696 0 475.862V15.996C0 7.16 7.16 0 15.996 0h459.866c8.834 0 15.996 7.16 15.996 15.996v459.866z' fill='white'/%3e%3c/svg%3e\");\n  background-size: 10px;\n}\n\n#testing-extension .app-ghost-button.for-reset {\n  background-color: #d40000;\n  background-image: url(\"data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' fill='white' version='1' width='439' height='439'%3e%3cpath d='M427 20c-7-4-14-2-20 4l-37 37a222 222 0 0 0-236-44A221 221 0 0 0 17 134a213 213 0 0 0 0 170 221 221 0 0 0 117 117 213 213 0 0 0 179-3c29-14 54-33 75-59 2-1 2-4 2-6l-3-6-39-39c-2-2-4-3-7-3-3 1-5 2-6 4a143 143 0 0 1-116 56A147 147 0 0 1 73 219 147 147 0 0 1 219 73c39 0 72 13 100 39l-39 40c-6 5-8 12-4 19 3 8 8 12 16 12h128c5 0 10-2 13-6 4-3 6-8 6-13V37c0-8-4-14-12-17z'/%3e%3c/svg%3e\");\n}\n\n#testing-extension .app-ghost-button.for-save {\n  background-color: #07b94b;\n  background-image: url(\"data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' height='683' viewBox='0 0 512 512' width='683'%3e%3cpath d='M410 279L256 432 102 279l28-29 106 106V0h40v356l106-106zm102 193H0v40h512zm0 0' fill='%23fff'/%3e%3c/svg%3e\");\n}\n\n#testing-extension .app-ghost-button.for-copy {\n  background-color: #007bff;\n  background-image: url(\"data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' height='683' viewBox='0 0 512 512' width='683'%3e%3cpath d='M433.941 65.941l-51.882-51.882A48 48 0 0 0 348.118 0H176c-26.51 0-48 21.49-48 48v48H48c-26.51 0-48 21.49-48 48v320c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48v-48h80c26.51 0 48-21.49 48-48V99.882a48 48 0 0 0-14.059-33.941zM266 464H54a6 6 0 0 1-6-6V150a6 6 0 0 1 6-6h74v224c0 26.51 21.49 48 48 48h96v42a6 6 0 0 1-6 6zm128-96H182a6 6 0 0 1-6-6V54a6 6 0 0 1 6-6h106v88c0 13.255 10.745 24 24 24h88v202a6 6 0 0 1-6 6zm6-256h-64V48h9.632c1.591 0 3.117.632 4.243 1.757l48.368 48.368a6 6 0 0 1 1.757 4.243V112z' fill='%23fff'/%3e%3c/svg%3e\");\n}\n\n#testing-extension .app.app-step-1 {\n  overflow: hidden;\n}\n\n#testing-extension .app.app-step-1 .app-controls {\n  height: 100%;\n  transition: 0.3s;\n}\n\n#testing-extension .app.app-step-1 .app-actions {\n  display: none;\n}\n\n#testing-extension .app.app-step-1 .app-action-step-2,\n#testing-extension .app.app-step-1 .app-action-step-3 {\n  height: 0;\n  overflow: hidden;\n  opacity: 0;\n  visibility: hidden;\n}\n\n#testing-extension .app.app-step-2 .app-controls {\n  height: 150px;\n}\n\n#testing-extension .app.app-step-2 .app-action-step-2 {\n  visibility: visible;\n  opacity: 1;\n}\n\n#testing-extension .app.app-step-2 .app-action-step-1,\n#testing-extension .app.app-step-2 .app-action-step-3 {\n  height: 0;\n  overflow: hidden;\n  opacity: 0;\n  visibility: hidden;\n}\n\n#testing-extension .app.app-step-3 .app-controls {\n  height: 150px;\n}\n\n#testing-extension .app.app-step-3 .app-action-step-3 {\n  visibility: visible;\n  opacity: 1;\n}\n\n#testing-extension .app.app-step-3 .app-action-step-2,\n#testing-extension .app.app-step-3 .app-action-step-1 {\n  height: 0;\n  overflow: hidden;\n  opacity: 0;\n  visibility: hidden;\n}\n\n#testing-extension .pulse {\n  -webkit-animation-name: app-pulse;\n  animation-name: app-pulse;\n  -webkit-animation-duration: 1.6s;\n  animation-duration: 1.6s;\n  -webkit-animation-iteration-count: infinite;\n  animation-iteration-count: infinite;\n}\n\n@-webkit-keyframes app-pulse {\n  50% {\n    opacity: 0.1;\n  }\n}\n\n@keyframes app-pulse {\n  50% {\n    opacity: 0.1;\n  }\n}"
  }
]