mirror of
https://github.com/hanzoai/insights-js.git
synced 2026-11-02 14:31:14 +00:00
Bulk rename across 989 files: - Package names: posthog-js → @hanzo/insights, posthog-node → @hanzo/insights-node, etc. - Repository URLs: posthog/posthog-js → hanzoai/insights-js - Brand names: PostHog → Insights - File renames: 259 reference JSON files, source files, workflow files - Directory rename: eslint-plugin-posthog-js → eslint-plugin-insights Remaining: 8 refs to @posthog/rrweb-* (real npm deps, need fork+publish)
61 lines
1.9 KiB
HTML
61 lines
1.9 KiB
HTML
<script src="../../dist/array.js"></script>
|
|
<script>
|
|
insights.init('sTMFPsFhdP1Ssg', {
|
|
api_host: 'http://127.0.0.1:8000',
|
|
autocapture: {
|
|
capture_copied_text: true,
|
|
},
|
|
debug: true,
|
|
persistence: 'memory',
|
|
loaded: function(insights) {
|
|
insights.identify('test')
|
|
},
|
|
before_send: (event) => {
|
|
if (event.event === '$copy_autocapture') {
|
|
const selectionType = event.properties['$copy_type']
|
|
const selectionText = event.properties['$selected_content']
|
|
document.getElementById('selection-type-outlet').innerText = selectionType
|
|
document.getElementById('selection-text-outlet').innerText = selectionText
|
|
}
|
|
return event
|
|
},
|
|
})
|
|
</script>
|
|
<h2>Demo site for Copy/Cut Autocapture</h2>
|
|
<button>Here's a button you could click if you want to</button><br /><br />
|
|
<body>
|
|
<div>
|
|
<a href="https://insights.hanzo.ai">Here's a link to the outside world</a>
|
|
</div>
|
|
<div id="shadow"></div>
|
|
|
|
<div style="padding: 2rem;background:green;display:none;color:white" id="feature"><h2>Look, a new beta feature</h2>
|
|
</div>
|
|
|
|
<div>
|
|
<p>This input is a password we shouldn't copy that</p>
|
|
<input value="i am secret" type="password" />
|
|
</div>
|
|
|
|
<div>
|
|
<p>The value below is marked no capture so we shouldn't copy that</p>
|
|
<div class='ph-no-capture'>I am a secret</div>
|
|
</div>
|
|
|
|
<div>
|
|
<h2>Result of selection autocapture</h2>
|
|
<p>Selection type is:
|
|
<div id="selection-type-outlet"></div>
|
|
</p>
|
|
<p>Selected text is:
|
|
<div id="selection-text-outlet"></div>
|
|
</p>
|
|
</div>
|
|
<script>
|
|
const header = document.createElement('header')
|
|
const shadowRoot = header.attachShadow({ mode: 'open' })
|
|
shadowRoot.innerHTML = '<div style="border: black 1px solid"><h2>shadowroot</h2><input value="some input text">bla</input></div>'
|
|
document.body.prepend(header)
|
|
</script>
|
|
</body>
|