@flashphoner/websdk 2.0.225 → 2.0.226

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.
@@ -1,4 +1,4 @@
1
- Web SDK - 2.0.225
1
+ Web SDK - 2.0.226
2
2
 
3
3
  [Download builds](https://docs.flashphoner.com/display/WEBSDK2EN/Web+SDK+release+notes)
4
4
 
@@ -6,6 +6,8 @@ var remoteVideo;
6
6
  var extensionId = "nlbaajplpmleofphigmgaifhoikjmbkg";
7
7
  var extensionNotInstalled;
8
8
 
9
+ var askExtension = getUrlParam("askExtension") || false;
10
+
9
11
  function init_page() {
10
12
  //init api
11
13
  try {
@@ -29,20 +31,22 @@ function init_page() {
29
31
 
30
32
  } else if (Browser.isChrome() && !Browser.isAndroid() && !Browser.isiOS()) {
31
33
  interval = setInterval(function() {
32
- chrome.runtime.sendMessage(extensionId, {type: "isInstalled"}, function (response) {
33
- if (chrome.runtime.lastError) { //WCS-2369 - cacth runtime.lastError
34
- (inIframe()) ? $("#installFromMarket").show() : $("#installExtensionButton").show();
35
- clearInterval(interval);
36
- onExtensionAvailable();
37
- $('#woChromeExtension').prop('checked', true);
38
- $('#woChromeExtension').prop('disabled', true);
39
- extensionNotInstalled = true;
40
- } else {
41
- $("#extension").hide();
34
+ try {
35
+ chrome.runtime.sendMessage(extensionId, {type: "isInstalled"}, function (response) {
36
+ if (chrome.runtime.lastError) { //WCS-2369 - catch runtime.lastError
37
+ onExtensionNotFound();
38
+ } else {
39
+ $("#extension").hide();
40
+ onExtensionAvailable();
41
+ }
42
42
  clearInterval(interval);
43
- onExtensionAvailable();
44
- }
45
- });
43
+ });
44
+ } catch (e) {
45
+ // Catch chrome.runtime.sendMessage undefined exception #WCS-3638
46
+ console.log("Can't detect screen sharing extension: "+e);
47
+ onExtensionNotFound();
48
+ clearInterval(interval);
49
+ }
46
50
  }, 500);
47
51
  } else if(isSafariMacOS()) {
48
52
  $("#extension").hide();
@@ -84,6 +88,22 @@ function isSafariMacOS() {
84
88
  return Browser.isSafari() && !Browser.isAndroid() && !Browser.isiOS();
85
89
  }
86
90
 
91
+ function onExtensionNotFound() {
92
+ if (askExtension === true) {
93
+ if (inIframe()) {
94
+ $("#installFromMarket").show();
95
+ } else {
96
+ $("#installExtensionButton").show();
97
+ }
98
+ } else {
99
+ $("#extension").hide();
100
+ }
101
+ onExtensionAvailable();
102
+ $('#woChromeExtension').prop('checked', true);
103
+ $('#woChromeExtension').prop('disabled', true);
104
+ extensionNotInstalled = true;
105
+ }
106
+
87
107
  function onExtensionAvailable() {
88
108
  localVideo = document.getElementById("localVideo");
89
109
  remoteVideo = document.getElementById("remoteVideo");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flashphoner/websdk",
3
- "version": "2.0.225",
3
+ "version": "2.0.226",
4
4
  "description": "Official Flashphoner WebCallServer WebSDK package",
5
5
  "main": "./src/flashphoner-core.js",
6
6
  "types": "./src/flashphoner-core.d.ts",