Steps to enable localhost Talisman Extension:
- Ensure Talisman Extension is installed and browser refreshed after install.
- Open manifest.json in the extension folder.
- Append
http://localhost:*/*
to wherever there’shttps://*/*
.
Example:
"content_scripts": [
{
"matches": ["https://*/*", "http://localhost:*/*"],
}
],
"permissions": ["https://*/*", "http://localhost:*/*", "storage", "tabs"],
- On chrome://extensions (or brave://extensions), reload the Talisman extension.
- On your Dapp, refresh the browser.
In the case there is an error parsing import.meta
and/or private class fields error, try adding the following to webpack config below.
Example for "unejected" Create React App projects, please see craco.config.js
below:
// craco.config.js
// Solution comes from https://polkadot.js.org/docs/usage/FAQ/#on-webpack-4-i-have-a-parse-error-on-importmetaurl
const ImportMetaLoaderPlugin = {
plugin: {
overrideWebpackConfig: ({ webpackConfig }) => {
if (!webpackConfig.module) webpackConfig.module = { rules: [] };
if (!webpackConfig.module.rules) webpackConfig.module.rules = [];
webpackConfig.module.rules.push({
test: /\.js$/,
loader: require.resolve('@open-wc/webpack-import-meta-loader'),
});
return webpackConfig;
},
},
};
const BabelPlugin = {
plugin: {
overrideCracoConfig: ({ cracoConfig }) => {
if (!cracoConfig.babel) cracoConfig.babel = {};
if (!Array.isArray(cracoConfig.babel.plugins))
cracoConfig.babel.plugins = [];
cracoConfig.babel.plugins.push('@babel/plugin-proposal-class-properties');
cracoConfig.babel.plugins.push('@babel/plugin-proposal-private-methods');
return cracoConfig;
},
},
};
module.exports = {
plugins: [BabelPlugin, ImportMetaLoaderPlugin],
};