MCPcopy Index your code
hub / github.com/OneNoteDev/WebClipper / getDefaultClipMode

Method getDefaultClipMode

src/scripts/clipperUI/clipper.tsx:543–570  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

541 }
542
543 private getDefaultClipMode(): ClipMode {
544 if (this.state && this.state.invokeOptions) {
545 switch (this.state.invokeOptions.invokeMode) {
546 case InvokeMode.ContextImage:
547 // We don't want to be stuck in region mode if there are 0 images
548 if (this.state.regionResult.data.length > 0) {
549 return ClipMode.Region;
550 }
551 break;
552 case InvokeMode.ContextTextSelection:
553 return ClipMode.Selection;
554 default:
555 break;
556 }
557 }
558
559 if (this.state && this.state.pageInfo) {
560 if (this.state.pageInfo.contentType === OneNoteApi.ContentType.EnhancedUrl) {
561 return ClipMode.Pdf;
562 }
563
564 if (UrlUtils.onWhitelistedDomain(this.state.pageInfo.rawUrl)) {
565 return ClipMode.Augmentation;
566 }
567 }
568
569 return ClipMode.FullPage;
570 }
571
572 private updateFrameHeight(newContainerHeight: number) {
573 Clipper.getInjectCommunicator().callRemoteFunction(Constants.FunctionKeys.updateFrameHeight, { param: newContainerHeight });

Callers 4

getInitialStateMethod · 0.95
getResetStateMethod · 0.95
setInvokeOptionsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected