|
@@ -74,6 +74,25 @@ function showDesktopSharingButton() {
|
74
|
74
|
}
|
75
|
75
|
}
|
76
|
76
|
|
|
77
|
+/**
|
|
78
|
+ * Initializes <link rel=chrome-webstore-item /> with extension id set in config.js to support inline installs.
|
|
79
|
+ * Host site must be selected as main website of published extension.
|
|
80
|
+ */
|
|
81
|
+function initInlineInstalls()
|
|
82
|
+{
|
|
83
|
+ $("link[rel=chrome-webstore-item]").attr("href", getWebStoreInstallUrl());
|
|
84
|
+}
|
|
85
|
+
|
|
86
|
+/**
|
|
87
|
+ * Constructs inline install URL for Chrome desktop streaming extension.
|
|
88
|
+ * The 'chromeExtensionId' must be defined in config.js.
|
|
89
|
+ * @returns {string}
|
|
90
|
+ */
|
|
91
|
+function getWebStoreInstallUrl()
|
|
92
|
+{
|
|
93
|
+ return "https://chrome.google.com/webstore/detail/" + config.chromeExtensionId;
|
|
94
|
+}
|
|
95
|
+
|
77
|
96
|
/*
|
78
|
97
|
* Toggles screen sharing.
|
79
|
98
|
*/
|
|
@@ -168,7 +187,7 @@ function obtainScreenFromExtension(streamCallback, failCallback) {
|
168
|
187
|
doGetStreamFromExtension(streamCallback, failCallback);
|
169
|
188
|
} else {
|
170
|
189
|
chrome.webstore.install(
|
171
|
|
- "https://chrome.google.com/webstore/detail/" + config.chromeExtensionId,
|
|
190
|
+ getWebStoreInstallUrl(),
|
172
|
191
|
function(arg) {
|
173
|
192
|
console.log("Extension installed successfully", arg);
|
174
|
193
|
// We need to reload the page in order to get the access to chrome.runtime
|
|
@@ -188,7 +207,6 @@ function checkExtInstalled(isInstalledCallback) {
|
188
|
207
|
if(!chrome.runtime) {
|
189
|
208
|
// No API, so no extension for sure
|
190
|
209
|
isInstalledCallback(false);
|
191
|
|
- return false;
|
192
|
210
|
}
|
193
|
211
|
chrome.runtime.sendMessage(
|
194
|
212
|
config.chromeExtensionId,
|