The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.
Send messages to iframe using iframeEl.contentWindow.postMessage
Recieve messages using window.addEventListener('message')
// yarn add --dev @esbuild-plugins/node-globals-polyfill | |
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill' | |
// yarn add --dev @esbuild-plugins/node-modules-polyfill | |
import { NodeModulesPolyfillPlugin } from '@esbuild-plugins/node-modules-polyfill' | |
// You don't need to add this to deps, it's included by @esbuild-plugins/node-modules-polyfill | |
import rollupNodePolyFill from 'rollup-plugin-node-polyfills' | |
export default { | |
resolve: { | |
alias: { |
Random rd = new Random(); | |
string remote_port = rd.Next(9000, 9999).ToString(); | |
// Open real Chrome | |
Process process = new Process(); | |
process.StartInfo.UseShellExecute = true; | |
process.StartInfo.FileName = "chrome"; | |
process.StartInfo.Arguments = "https://thgiang.com --load-extension=\"C:\\Users\\Admin\\Desktop\\my_extension\" --disable-gpu --new-window --remote-debugging-port=" + remote_port + " --user-data-dir=\"C:\\Profile\" --proxy-server=\""+proxy+"\" --disable-infobars --disable-notifications --window-size=1366,768"; //--window-position=0,0 --window-size=1200,800 --disable-images | |
process.Start(); | |
Thread.Sleep(1000); |
import { LedgerEthereumClient, Web3ProviderEngine as ProviderEngine } from '@0x/subproviders/lib/src'; // https://github.com/0xProject/0x-monorepo/issues/1400 | |
import { LedgerSubprovider } from '@0x/subproviders/lib/src/subproviders/ledger'; // https://github.com/0xProject/0x-monorepo/issues/1400 | |
import CacheSubprovider from 'web3-provider-engine/subproviders/cache'; | |
import Eth from '@ledgerhq/hw-app-eth'; | |
import TransportWebUSB from '@ledgerhq/hw-transport-webusb'; | |
export enum LedgerDerivationPath { | |
'Legacy' = "44'/60'/0'", | |
'LedgerLive' = "44'/60'/0'/0", | |
} |
/* | |
Autoload all current vue files as component and register them by their name. | |
--- | |
Author: Gkiokan Sali | |
Date: 2019-05-09 | |
*/ | |
import Vue from 'vue' | |
const requireContext = require.context('./', false, /.*\.vue$/) |
v-model uses the @input event by default, so if you want to use v-model on a custom component you need to emit the input event to the parent. So, in your component, you simply do: | |
<input class="product_name form-control" @input="$emit('input', $event.target.value)" /> | |
Now in your parent you can do: | |
<products-list v-model="product.name"></products-list> | |
You can see the full example on this JSFiddle: https://jsfiddle.net/7s2ugt11/ |
git reset --hard <prev_commit_id> | |
git push --force |
axios.put(this.apiBaseEndpoint + '/' + id, input) | |
.then((response) => { | |
// Success | |
}) | |
.catch((error) => { | |
// Error | |
if (error.response) { | |
// The request was made and the server responded with a status code | |
// that falls out of the range of 2xx | |
// console.log(error.response.data); |
/* styles for '...' */ | |
.block-with-text { | |
/* hide text if it more than N lines */ | |
overflow: hidden; | |
/* for set '...' in absolute position */ | |
position: relative; | |
/* use this value to count block height */ | |
line-height: 1.2em; | |
/* max-height = line-height (1.2) * lines max number (3) */ | |
max-height: 3.6em; |
$("p, h1, h2, h3, h4, h5, span").each(function() { | |
$(this).on("mouseenter", function() { | |
$(this).css("background-color", "#F1A9A2"); | |
$(this).on("mouseleave", function() { | |
$(this).css("background-color", ""); | |
}); | |
}); | |
$(this).on("click", function() { | |
console.log($(this).text()); | |
}); |