{"id":13479529,"url":"https://github.com/pd4d10/console-importer","last_synced_at":"2025-04-13T00:44:09.941Z","repository":{"id":17625151,"uuid":"82370548","full_name":"pd4d10/console-importer","owner":"pd4d10","description":"Easily import JS and CSS resources from Chrome console.","archived":false,"fork":false,"pushed_at":"2023-04-19T14:53:21.000Z","size":3041,"stargazers_count":904,"open_issues_count":17,"forks_count":63,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-04-13T00:44:03.097Z","etag":null,"topics":["browser-extension","chrome-extension","console","css","javascript","resources"],"latest_commit_sha":null,"homepage":"https://chrome.google.com/webstore/detail/console-importer/hgajpakhafplebkdljleajgbpdmplhie","language":"TypeScript","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/pd4d10.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-02-18T07:46:14.000Z","updated_at":"2025-04-12T14:08:20.000Z","dependencies_parsed_at":"2024-01-13T17:48:21.474Z","dependency_job_id":"0821482c-c08f-4ab2-9705-5bedeb911179","html_url":"https://github.com/pd4d10/console-importer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pd4d10%2Fconsole-importer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pd4d10%2Fconsole-importer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pd4d10%2Fconsole-importer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pd4d10%2Fconsole-importer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pd4d10","download_url":"https://codeload.github.com/pd4d10/console-importer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650419,"owners_count":21139672,"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":["browser-extension","chrome-extension","console","css","javascript","resources"],"created_at":"2024-07-31T16:02:18.510Z","updated_at":"2025-04-13T00:44:09.904Z","avatar_url":"https://github.com/pd4d10.png","language":"TypeScript","readme":"# Console Importer\n\n[![Chrome Web Store](https://img.shields.io/chrome-web-store/v/hgajpakhafplebkdljleajgbpdmplhie.svg)](https://chrome.google.com/webstore/detail/console-importer/hgajpakhafplebkdljleajgbpdmplhie)\n[![Chrome Web Store](https://img.shields.io/chrome-web-store/d/hgajpakhafplebkdljleajgbpdmplhie.svg)](https://chrome.google.com/webstore/detail/console-importer/hgajpakhafplebkdljleajgbpdmplhie)\n[![Chrome Web Store](https://img.shields.io/chrome-web-store/stars/hgajpakhafplebkdljleajgbpdmplhie.svg)](https://chrome.google.com/webstore/detail/console-importer/hgajpakhafplebkdljleajgbpdmplhie)\n\n\u003cimg src=\"assets/js.gif\" alt=\"Demo\" width=\"640\" /\u003e\n\n## Installation\n\nInstall it from Chrome Web Store:\n\nhttps://chrome.google.com/webstore/detail/console-importer/hgajpakhafplebkdljleajgbpdmplhie\n\n## Usage\n\nOpen Chrome devtools console, a function named `$i` could be used to import JavaScript and CSS resources.\n\n```js\n$i('jquery')\n```\n\nImport specific version:\n\n```js\n$i('jquery@2')\n```\n\nAlso, you can import a valid script URL:\n\n```js\n$i('https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js')\n```\n\nCSS is supported, too:\n\n```js\n$i('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css')\n```\n\n### Import ES Module\n\nES module has been widely supported in modern browsers. `$i.esm` method can be useful in this case:\n\n```js\nd3 = await $i.esm('d3')\n```\n\nor specify a version:\n\n```js\nd3 = await $i.esm('d3@7')\n```\n\nThe advantage of this approach is that no global variables are added to the window, which allows better control over the scope of side effects. For more details, see https://esm.run.\n\n## Trouble shooting\n\n### Q: `$i` doesn't work as expected\n\nSome websites like Google Inbox already have `$i` used as a global variable. This extension doesn't overwrite it.\n\nYou can use `console.$i` on these websites.\n\n### Q: `$i` fail to import resources\n\nOn some websites like GitHub, `$i` will fail to import resources. Console errors may be like follows:\n\n```sh\n# js errors example\nRefused to connect to 'https://api.cdnjs.com/libraries?search=jquery' because it violates the following Content Security Policy directive:\n\n# css errors example\nRefused to load the stylesheet 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css' because it violates the following Content Security Policy directive:\n```\n\nIt is because of strict Content Security Policy of these websites. For more information, see [Content Security Policy (CSP) wiki](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP)\n\n## How does it work?\n\n- If it is like a JavaScript lib name, like `jquery`, try to load it from cdnjs\n- If it has version number, like `jquery@2`, try to load it from unpkg\n- If it is a valid URL(CSS or JS), load it directly\n\nFor advanced use, there are also two functions `$i.unpkg` and `$i.cdnjs` which could be used to import resources from specific CDN.\n\n## License\n\nMIT\n","funding_links":[],"categories":["TypeScript","JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpd4d10%2Fconsole-importer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpd4d10%2Fconsole-importer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpd4d10%2Fconsole-importer/lists"}