fix: backward comp cache web script
This commit is contained in:
@@ -88,7 +88,7 @@ We built OpenPanel from the ground up with privacy at its heart—and with featu
|
|||||||
|
|
||||||
```html
|
```html
|
||||||
<script>
|
<script>
|
||||||
window.op=window.op||function(){var n=[],o=new Proxy((function(){arguments.length>0&&n.push(Array.prototype.slice.call(arguments))}),{get:function(o,t){return"q"===t?n:function(){n.push([t].concat(Array.prototype.slice.call(arguments)))}}});return o}();
|
window.op=window.op||function(){var n=[];return new Proxy(function(){arguments.length&&n.push([].slice.call(arguments))},{get:function(t,r){return"q"===r?n:function(){n.push([r].concat([].slice.call(arguments)))}} ,has:function(t,r){return"q"===r}}) }();
|
||||||
window.op('init', {
|
window.op('init', {
|
||||||
clientId: 'YOUR_CLIENT_ID',
|
clientId: 'YOUR_CLIENT_ID',
|
||||||
trackScreenViews: true,
|
trackScreenViews: true,
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ Once your proxy is running, you need to configure the OpenPanel script on your f
|
|||||||
|
|
||||||
```html
|
```html
|
||||||
<script>
|
<script>
|
||||||
window.op=window.op||function(){var n=[],o=new Proxy((function(){arguments.length>0&&n.push(Array.prototype.slice.call(arguments))}),{get:function(o,t){return"q"===t?n:function(){n.push([t].concat(Array.prototype.slice.call(arguments)))}}});return o}();
|
window.op=window.op||function(){var n=[];return new Proxy(function(){arguments.length&&n.push([].slice.call(arguments))},{get:function(t,r){return"q"===r?n:function(){n.push([r].concat([].slice.call(arguments)))}} ,has:function(t,r){return"q"===r}}) }();
|
||||||
window.op('init', {
|
window.op('init', {
|
||||||
apiUrl: 'https://api.domain.com'
|
apiUrl: 'https://api.domain.com'
|
||||||
clientId: 'YOUR_CLIENT_ID',
|
clientId: 'YOUR_CLIENT_ID',
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ Just insert this snippet and replace `YOUR_CLIENT_ID` with your client id.
|
|||||||
|
|
||||||
```html title="index.html" /clientId: 'YOUR_CLIENT_ID'/
|
```html title="index.html" /clientId: 'YOUR_CLIENT_ID'/
|
||||||
<script>
|
<script>
|
||||||
window.op=window.op||function(){var n=[],o=new Proxy((function(){arguments.length>0&&n.push(Array.prototype.slice.call(arguments))}),{get:function(o,t){return"q"===t?n:function(){n.push([t].concat(Array.prototype.slice.call(arguments)))}}});return o}();
|
window.op=window.op||function(){var n=[];return new Proxy(function(){arguments.length&&n.push([].slice.call(arguments))},{get:function(t,r){return"q"===r?n:function(){n.push([r].concat([].slice.call(arguments)))}} ,has:function(t,r){return"q"===r}}) }();
|
||||||
window.op('init', {
|
window.op('init', {
|
||||||
clientId: 'YOUR_CLIENT_ID',
|
clientId: 'YOUR_CLIENT_ID',
|
||||||
trackScreenViews: true,
|
trackScreenViews: true,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ Simply add this script tag to your website's `<head>` section.
|
|||||||
|
|
||||||
```html title="index.html"
|
```html title="index.html"
|
||||||
<script>
|
<script>
|
||||||
window.op=window.op||function(){var n=[],o=new Proxy((function(){arguments.length>0&&n.push(Array.prototype.slice.call(arguments))}),{get:function(o,t){return"q"===t?n:function(){n.push([t].concat(Array.prototype.slice.call(arguments)))}}});return o}();
|
window.op=window.op||function(){var n=[];return new Proxy(function(){arguments.length&&n.push([].slice.call(arguments))},{get:function(t,r){return"q"===r?n:function(){n.push([r].concat([].slice.call(arguments)))}} ,has:function(t,r){return"q"===r}}) }();
|
||||||
window.op('init', {
|
window.op('init', {
|
||||||
clientId: 'YOUR_CLIENT_ID',
|
clientId: 'YOUR_CLIENT_ID',
|
||||||
trackScreenViews: true,
|
trackScreenViews: true,
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ The path should be `/api` and the domain should be your domain.
|
|||||||
|
|
||||||
```html title="index.html"
|
```html title="index.html"
|
||||||
<script>
|
<script>
|
||||||
window.op=window.op||function(){var n=[],o=new Proxy((function(){arguments.length>0&&n.push(Array.prototype.slice.call(arguments))}),{get:function(o,t){return"q"===t?n:function(){n.push([t].concat(Array.prototype.slice.call(arguments)))}}});return o}();
|
window.op=window.op||function(){var n=[];return new Proxy(function(){arguments.length&&n.push([].slice.call(arguments))},{get:function(t,r){return"q"===r?n:function(){n.push([r].concat([].slice.call(arguments)))}} ,has:function(t,r){return"q"===r}}) }();
|
||||||
window.op('init', {
|
window.op('init', {
|
||||||
apiUrl: 'https://your-domain.com/api', // [!code highlight]
|
apiUrl: 'https://your-domain.com/api', // [!code highlight]
|
||||||
clientId: 'YOUR_CLIENT_ID',
|
clientId: 'YOUR_CLIENT_ID',
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ const ConnectWeb = ({ client }: Props) => {
|
|||||||
<Syntax
|
<Syntax
|
||||||
className="border"
|
className="border"
|
||||||
code={`<script>
|
code={`<script>
|
||||||
window.op=window.op||function(){var n=[],o=new Proxy((function(){arguments.length>0&&n.push(Array.prototype.slice.call(arguments))}),{get:function(o,t){return"q"===t?n:function(){n.push([t].concat(Array.prototype.slice.call(arguments)))}}});return o}();
|
window.op=window.op||function(){var n=[];return new Proxy(function(){arguments.length&&n.push([].slice.call(arguments))},{get:function(t,r){return"q"===r?n:function(){n.push([r].concat([].slice.call(arguments)))}} ,has:function(t,r){return"q"===r}}) }();
|
||||||
window.op('init', {
|
window.op('init', {
|
||||||
clientId: '${client?.id ?? 'YOUR_CLIENT_ID'}',
|
clientId: '${client?.id ?? 'YOUR_CLIENT_ID'}',
|
||||||
trackScreenViews: true,
|
trackScreenViews: true,
|
||||||
|
|||||||
@@ -19,5 +19,5 @@
|
|||||||
// })();
|
// })();
|
||||||
|
|
||||||
export function getInitSnippet(): string {
|
export function getInitSnippet(): string {
|
||||||
return `window.op=window.op||function(){var n=[],o=new Proxy((function(){arguments.length>0&&n.push(Array.prototype.slice.call(arguments))}),{get:function(o,t){return"q"===t?n:function(){n.push([t].concat(Array.prototype.slice.call(arguments)))}}});return o}();`;
|
return `window.op=window.op||function(){var n=[];return new Proxy(function(){arguments.length&&n.push([].slice.call(arguments))},{get:function(t,r){return"q"===r?n:function(){n.push([r].concat([].slice.call(arguments)))}} ,has:function(t,r){return"q"===r}}) }();`;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user