Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

Trying to load as "unpacked addon" throws error.... #193

Closed
ZacWolf opened this issue Aug 1, 2019 · 2 comments
Closed

Trying to load as "unpacked addon" throws error.... #193

ZacWolf opened this issue Aug 1, 2019 · 2 comments

Comments

@ZacWolf
Copy link

ZacWolf commented Aug 1, 2019

When I follow the instructions from the readme.md and then load the extension in Chrome via "load unpacked" I'm getting the error:

Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' blob: filesystem: chrome-extension-resource:".
Context
_generated_background_page.html
Stack Trace
background.js:411 (anonymous function)

Line 411 is:

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var webext_options_sync__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! webext-options-sync */ \"./node_modules/webext-options-sync/webext-options-sync.js\");\n/* harmony import */ var webext_options_sync__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(webext_options_sync__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _features__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./features */ \"./source/features/index.js\");\n\n\nconst optionsSync = new webext_options_sync__WEBPACK_IMPORTED_MODULE_0___default.a(); // Define defaults\n\noptionsSync.define({\n  defaults: Object.assign({}, _features__WEBPACK_IMPORTED_MODULE_1__[\"featuresDefaultValues\"], {\n    logging: false\n  }),\n  migrations: [webext_options_sync__WEBPACK_IMPORTED_MODULE_0___default.a.migrations.removeUnused]\n}); // Make sure that all features have an option value\n\noptionsSync.getAll().then(options => {\n  const newOptions = Object.assign({}, _features__WEBPACK_IMPORTED_MODULE_1__[\"featuresDefaultValues\"], options);\n  optionsSync.setAll(newOptions);\n}); // Fix the extension when right-click saving a tweet image\n\nbrowser.downloads.onDeterminingFilename.addListener((item, suggest) => {\n  suggest({\n    filename: item.filename.replace(/\\.(jpg|png)_(large|orig)$/, '.$1')\n  });\n});\nbrowser.webRequest.onBeforeRequest.addListener(({\n  url\n}) => {\n  if (url.endsWith(':large')) {\n    return {\n      redirectUrl: url.replace(/:large$/, ':orig')\n    };\n  }\n}, {\n  urls: ['https://pbs.twimg.com/media/*']\n}, ['blocking']);\nbrowser.runtime.onMessage.addListener(request => {\n  if (request.contentScriptQuery === 'getInstagramPhotoUrl') {\n    const url = `https://instagram.com/p/${request.postID}`;\n    return fetch(url).then(response => response.text());\n  }\n});\n\n//# sourceURL=webpack:///./source/background.js?");

I'm trying to test a change I've made to:
source/features/hide-promoted-tweets.js
...to select based on Twitter's new usage of semantic tags vs CSS named tags.

My changes:

export default function () {
	$('.promoted-tweet').parent().hide();
	$("span:contains('Promoted')").parents("article").hide();
}
@ahmetb
Copy link

ahmetb commented Mar 16, 2020

+1 I'm also hitting this problem. I just followed the "Contributing" tab and upon loading unpacked extension, it immediately have the error above.

@sindresorhus
Copy link
Owner

Closing as this extension is now deprecated: 8dd9df7

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants