@yak-io/javascript 0.11.2 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -361,6 +361,7 @@ var YakClient = class {
361
361
  }
362
362
  startObserving() {
363
363
  if (typeof window === "undefined" || !this.iframeWindow) return;
364
+ if (this.config.options?.disablePageContent) return;
364
365
  const currentUrl = window.location.href;
365
366
  if (currentUrl !== this.lastUrl) {
366
367
  this.lastUrl = currentUrl;
@@ -513,6 +514,7 @@ var YakClient = class {
513
514
  }
514
515
  sendPageContext() {
515
516
  if (!this.iframeWindow) return;
517
+ if (this.config.options?.disablePageContent) return;
516
518
  try {
517
519
  const pageContext = extractPageContext();
518
520
  const message = {
@@ -1233,6 +1235,7 @@ var YakVoiceSession = class {
1233
1235
  }
1234
1236
  }
1235
1237
  safeExtractPageContext() {
1238
+ if (this.config.disablePageContent) return void 0;
1236
1239
  try {
1237
1240
  return extractPageContext();
1238
1241
  } catch {
@@ -1568,7 +1571,8 @@ var YakEmbed = class {
1568
1571
  getConfig: config.getConfig,
1569
1572
  chatConfig: config.chatConfig,
1570
1573
  onToolCall: config.onToolCall,
1571
- onRedirect: config.onRedirect
1574
+ onRedirect: config.onRedirect,
1575
+ disablePageContent: config.options?.disablePageContent
1572
1576
  };
1573
1577
  this.voice = new YakVoiceSession(voiceConfig);
1574
1578
  } else {