Skip to content

Commit

Permalink
migrate to manifest-v3 by @neverthirty
Browse files Browse the repository at this point in the history
  • Loading branch information
tolya-yanot committed Mar 4, 2022
1 parent 746569d commit 49f3f5f
Show file tree
Hide file tree
Showing 14 changed files with 231 additions and 155 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ https://chrome.google.com/webstore/detail/ton-wallet/nphplpgoakhhjchkkhmiggakijn

`npm install`

`gulp`

`npx webpack --mode=none`
`npm run build`

# Code

Expand Down
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ gulp.task('copy', function () {
'src/assets/**',
'src/libs/**',
'src/**/*.html',
'src/contentscript.js',
'src/js/extension/*',
'src/manifest.json'
], {base: 'src'})
.pipe(gulp.dest('build'));
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"natives": "^1.1.6"
},
"scripts": {
"build:contentscript": "sed -e \"/%%PROVIDER_CODE%%/r src/tonProvider.js\" -e \"//d\" src/contentscript.js.tpl > src/contentscript.js",
"build": "npm run build:contentscript && gulp && npx webpack --mode=none",
"build": "gulp && npx webpack --mode=none",
"build:docs": "npm run build && cp -r build/ docs/",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions src/contentscript.js.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ injectScript(code); // inject to dapp page
const port = chrome.runtime.connect({name: 'gramWalletContentScript'})
port.onMessage.addListener(function (msg) {
// Receive msg from Controller.js and resend to dapp page
window.postMessage(msg, "*"); // todo: origin
self.postMessage(msg, "*"); // todo: origin
});

window.addEventListener('message', function (event) {
self.addEventListener('message', function (event) {
if (event.data && (event.data.type === 'gramWalletAPI_ton_provider_write' || event.data.type === 'gramWalletAPI_ton_provider_connect')) {
// Receive msg from dapp page and resend to Controller.js
port.postMessage(event.data);
Expand Down
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ <h4>What is TON Magic?</h4>
<script type="text/javascript" src="libs/lottie-web/5.6.3/lottie_canvas.min.js"></script>
<script type="text/javascript" src="libs/EasyQRcodeJS.js"></script>

<script type="text/javascript" src="libs/tonweb-0.0.32.js"></script>
<script type="text/javascript" src="libs/tonweb-0.0.33.js"></script>
<script type="text/javascript" src="libs/tonweb-mnemonic-1.0.1.js"></script>

<script src="js/view/View.js?51" type="module"></script>
Expand Down
Loading

0 comments on commit 49f3f5f

Please sign in to comment.