@@ -26,7 +26,7 @@ import {InvokeSource} from "../invokeSource";
26
26
import { InjectUrls } from "./injectUrls" ;
27
27
import { WebExtension } from "./webExtension" ;
28
28
import { WebExtensionBackgroundMessageHandler } from "./webExtensionMessageHandler" ;
29
- import { WebExtensionNotifications } from "./webExtensionNotifications" ;
29
+ // import {WebExtensionNotifications} from "./webExtensionNotifications";
30
30
31
31
type Tab = chrome . tabs . Tab ;
32
32
type TabRemoveInfo = chrome . tabs . TabRemoveInfo ;
@@ -100,32 +100,33 @@ export class WebExtensionWorker extends ExtensionWorkerBase<W3CTab, number> {
100
100
clientInfo : this . clientInfo
101
101
} ) ;
102
102
103
- // The ability to get a store link from the url is only available to Chrome so far (as of 10/21/16)
104
- let extensionUrlRegex = / ^ c h r o m e - e x t e n s i o n : \/ \/ ( \w + ) \W / ;
105
- if ( this . clientInfo . get ( ) . clipperType === ClientType . ChromeExtension && extensionUrlRegex . test ( this . tab . url ) ) {
106
- let extensionId = this . tab . url . match ( extensionUrlRegex ) [ 1 ] ;
107
- let extensionUrl = "https://chrome.google.com/webstore/detail/" + extensionId ;
108
-
109
- WebExtensionNotifications . setButtonListener ( ( notificationId , buttonIndex ) => {
110
- if ( notificationId === Constants . Extension . NotificationIds . conflictingExtension && buttonIndex === 0 ) {
111
- window . open ( extensionUrl ) ;
112
- WebExtension . browser . notifications . clear ( Constants . Extension . NotificationIds . conflictingExtension ) ;
113
- }
114
- } ) ;
115
-
116
- WebExtension . browser . notifications . create ( Constants . Extension . NotificationIds . conflictingExtension , {
117
- type : "basic" ,
118
- title : Localization . getLocalizedString ( "WebClipper.Label.OneNoteWebClipper" ) ,
119
- message : Localization . getLocalizedString ( "WebClipper.Error.ConflictingExtension" ) ,
120
- buttons : [ { title : extensionUrl } ] ,
121
- iconUrl : "icons/icon-256.png"
122
- } ) ;
123
- } else {
124
- // In Firefox, alert() is not callable from the background, so it looks like we have to no-op here
125
- if ( this . clientInfo . get ( ) . clipperType !== ClientType . FirefoxExtension ) {
126
- InjectHelper . alertUserOfUnclippablePage ( ) ;
127
- }
103
+ // // The ability to get a store link from the url is only available to Chrome so far (as of 10/21/16)
104
+ // let extensionUrlRegex = /^chrome-extension:\/\/(\w+)\W/;
105
+ // if (this.clientInfo.get().clipperType === ClientType.ChromeExtension && extensionUrlRegex.test(this.tab.url)) {
106
+ // let extensionId = this.tab.url.match(extensionUrlRegex)[1];
107
+ // let extensionUrl = "https://chrome.google.com/webstore/detail/" + extensionId;
108
+
109
+ // WebExtensionNotifications.setButtonListener((notificationId, buttonIndex) => {
110
+ // if (notificationId === Constants.Extension.NotificationIds.conflictingExtension && buttonIndex === 0) {
111
+ // window.open(extensionUrl);
112
+ // WebExtension.browser.notifications.clear(Constants.Extension.NotificationIds.conflictingExtension);
113
+ // }
114
+ // });
115
+
116
+ // WebExtension.browser.notifications.create(Constants.Extension.NotificationIds.conflictingExtension, {
117
+ // type: "basic",
118
+ // title: Localization.getLocalizedString("WebClipper.Label.OneNoteWebClipper"),
119
+ // message: Localization.getLocalizedString("WebClipper.Error.ConflictingExtension"),
120
+ // buttons: [{ title: extensionUrl }],
121
+ // iconUrl: "icons/icon-256.png"
122
+ // });
123
+ // } else {
124
+
125
+ // In Firefox, alert() is not callable from the background, so it looks like we have to no-op here
126
+ if ( this . clientInfo . get ( ) . clipperType !== ClientType . FirefoxExtension ) {
127
+ InjectHelper . alertUserOfUnclippablePage ( ) ;
128
128
}
129
+ // }
129
130
resolve ( false ) ;
130
131
} else {
131
132
WebExtension . browser . tabs . executeScript ( this . tab . id , { file : this . injectUrls . webClipperInjectUrl } ) ;
0 commit comments