{"id":16988763,"url":"https://github.com/seho-dev/webtagposition","last_synced_at":"2025-08-23T23:08:54.155Z","repository":{"id":125987383,"uuid":"291759435","full_name":"seho-dev/WebTagPosition","owner":"seho-dev","description":"基于webkit内核浏览器插件，适用于谷歌，360，qq等浏览器 :  右键网页选中当前阅读的内容进行定位，下一次再进入会提示用户是否回到上次阅读的地方继续阅读的工具","archived":false,"fork":false,"pushed_at":"2020-09-01T15:45:51.000Z","size":183,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-15T08:11:28.438Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seho-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-31T15:55:03.000Z","updated_at":"2022-04-06T06:41:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"83b5af2f-d8db-4a7c-b2e9-62e9125a667c","html_url":"https://github.com/seho-dev/WebTagPosition","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"2a1de374c2194b2cbc89538937526f3220bf70e1"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seho-dev%2FWebTagPosition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seho-dev%2FWebTagPosition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seho-dev%2FWebTagPosition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seho-dev%2FWebTagPosition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seho-dev","download_url":"https://codeload.github.com/seho-dev/WebTagPosition/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244898410,"owners_count":20528335,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T03:04:42.656Z","updated_at":"2025-03-22T02:44:44.123Z","avatar_url":"https://github.com/seho-dev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chrome Extension Webpack Boilerplate\n\nA basic foundation boilerplate for rich Chrome Extensions using [Webpack](https://webpack.github.io/) to help you write modular and modern Javascript code, load CSS easily and [automatic reload the browser on code changes](https://webpack.github.io/docs/webpack-dev-server.html#automatic-refresh).\n\n## Developing a new extension\n_I'll assume that you already read the [Webpack docs](https://webpack.github.io/docs) and the [Chrome Extension](https://developer.chrome.com/extensions/getstarted) docs._\n\n\n1. Check if your Node.js version is \u003e= 6.\n2. Clone the repository.\n3. Install [yarn](https://yarnpkg.com/lang/en/docs/install/).\n4. Run `yarn`.\n5. Change the package's name and description on `package.json`.\n6. Change the name of your extension on `src/manifest.json`.\n7. Run `npm run start`\n8. Load your extension on Chrome following:\n    1. Access `chrome://extensions/`\n    2. Check `Developer mode`\n    3. Click on `Load unpacked extension`\n    4. Select the `build` folder.\n8. Have fun.\n\n## Structure\nAll your extension's development code must be placed in `src` folder, including the extension manifest.\n\nThe boilerplate is already prepared to have a popup, a options page and a background page. You can easily customize this.\n\nEach page has its own [assets package defined](https://github.com/samuelsimoes/chrome-extension-webpack-boilerplate/blob/master/webpack.config.js#L16-L20). So, to code on popup you must start your code on `src/js/popup.js`, for example.\n\nYou must use the [ES6 modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import) to a better code organization. The boilerplate is already prepared to that and [here you have a little example](https://github.com/samuelsimoes/chrome-extension-webpack-boilerplate/blob/master/src/js/popup.js#L2-L4).\n\n## Webpack auto-reload and HRM\nTo make your workflow much more efficient this boilerplate uses the [webpack server](https://webpack.github.io/docs/webpack-dev-server.html) to development (started with `npm run server`) with auto reload feature that reloads the browser automatically every time that you save some file o your editor.\n\nYou can run the dev mode on other port if you want. Just specify the env var `port` like this:\n\n```\n$ PORT=6002 npm run start\n```\n\n## Content Scripts\n\nAlthough this boilerplate uses the webpack dev server, it's also prepared to write all your bundles files on the disk at every code change, so you can point, on your extension manifest, to your bundles that you want to use as [content scripts](https://developer.chrome.com/extensions/content_scripts), but you need to exclude these entry points from hot reloading [(why?)](https://github.com/samuelsimoes/chrome-extension-webpack-boilerplate/issues/4#issuecomment-261788690). To do so you need to expose which entry points are content scripts on the `webpack.config.js` using the `chromeExtensionBoilerplate -\u003e notHotReload` config. Look the example below.\n\nLet's say that you want use the `myContentScript` entry point as content script, so on your `webpack.config.js` you will configure the entry point and exclude it from hot reloading, like this:\n\n```js\n{\n  …\n  entry: {\n    myContentScript: \"./src/js/myContentScript.js\"\n  },\n  chromeExtensionBoilerplate: {\n    notHotReload: [\"myContentScript\"]\n  }\n  …\n}\n```\n\nand on your `src/manifest.json`:\n\n```json\n{\n  \"content_scripts\": [\n    {\n      \"matches\": [\"https://www.google.com/*\"],\n      \"js\": [\"myContentScript.bundle.js\"]\n    }\n  ]\n}\n\n```\n\n## Packing\nAfter the development of your extension run the command\n\n```\n$ NODE_ENV=production npm run build\n```\nNow, the content of `build` folder will be the extension ready to be submitted to the Chrome Web Store. Just take a look at the [official guide](https://developer.chrome.com/webstore/publish) to more infos about publishing.\n\n## Secrets\nIf you are developing an extension that talks with some API you probably are using different keys for testing and production. Is a good practice you not commit your secret keys and expose to anyone that have access to the repository.\n\nTo this task this boilerplate import the file `./secrets.\u003cTHE-NODE_ENV\u003e.js` on your modules through the module named as `secrets`, so you can do things like this:\n\n_./secrets.development.js_\n\n```js\nexport default { key: \"123\" };\n```\n\n_./src/popup.js_\n\n```js\nimport secrets from \"secrets\";\nApiCall({ key: secrets.key });\n```\n:point_right: The files with name `secrets.*.js` already are ignored on the repository.\n\n## With React.js\n:bulb: If you want use [React.js](https://facebook.github.io/react/) with this boilerplate, check the **[react branch](https://github.com/samuelsimoes/chrome-extension-webpack-boilerplate/tree/react)**.\n\n\n## Contributing\n\n1. **Please!! Do not create a pull request without an issue before discussing the problem.**\n2. On your PR make sure that you are following the current codebase style.\n3. Your PR must be single purpose. Resolve just one problem on your PR.\n4. Make sure to commit in the same style that we are committing until now on the project.\n\n-------------\nSamuel Simões ~ [@samuelsimoes](https://twitter.com/samuelsimoes) ~ [Blog](http://blog.samuelsimoes.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseho-dev%2Fwebtagposition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseho-dev%2Fwebtagposition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseho-dev%2Fwebtagposition/lists"}