# mac / linux 用戶
$ ./N_m3u8DL-RE https://xxxx.xxxx.com/playlist.m3u8
# windows 用戶
C:\Users\jim\Desktop> N_m3u8DL-RE.exe https://xxxx.xxxx.com/playlist.m3u8
chrome.runtime.onMessageExternal.addListener((request, sender, sendResponse) => {
console.log('[Demo] receive from other extension or web app', request);
sendResponse({response: "pong from background"});
});
實測結果如下:
inject script log
background log
傳送至 content script
在 inject script
async function sendMsgToContentScript() {
window.postMessage({msg: 'ping from inject script', from: 'inject-script'});
}
Content scripts are less trustworthy than the extension background page. Assume that messages from a content script might have been crafted by an attacker and make sure to validate and sanitize all input. Assume any data sent to the content script might leak to the web page. Limit the scope of privileged actions that can be triggered by messages received from content scripts.
IPNS 全名 InterPlanetary Name System。操作原理如下: 每一個節點初始化後都會預設一把 key,IPNS 可以用這把 key 的 public key hash 作為 domain name,將其指向一特定的 CID,就好像傳統 DNS 服務,將網域指向某一個 IP !
實際操作方式,進入 IPFS container 鍵入以下指令
$ ipfs name publish /ipfs/<CID>
比如說:
$ ipfs name publish /ipfs/QmV3NBfZLSFq8oQgiEKBraiEWEyrpPcDeifWUEahUuzRfc
Published to k51qzi5uqu5dlw5jnmyj9sviak0nlpvho02o53zwudqaesjr9tsqfi75idt0nk: /ipfs/QmV3NBfZLSFq8oQgiEKBraiEWEyrpPcDeifWUEahUuzRfc
<code>ipfs resolve -r /ipfs/QmV3NBfZLSFq8oQgiEKBraiEWEyrpPcDeifWUEahUuzRfc/contract/0x79fcdef22feed20eddacbb2587640e45491b757f: no link named "contract" under QmV3NBfZLSFq8oQgiEKBraiEWEyrpPcDeifWUEahUuzRfc</code>
ERROR in ../node_modules/eth-lib/lib/bytes.js
Module not found: Error: Can't resolve 'crypto' in '*/node_modules/eth-lib/lib'
ERROR in ../node_modules/web3-eth-accounts/node_modules/eth-lib/lib/bytes.js
Module not found: Error: Can't resolve 'crypto' in '*/node_modules/web3-eth-accounts/node_modules/eth-lib/lib'