OneNote Clipper

The clipper Bookmarklet

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey to install this script.

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        OneNote Clipper
// @namespace   https://github.com/vylet/OneNote
// @description The clipper Bookmarklet
// @include			http://*
// @include			https://*
// @version     1.0
// @grant       none
// ==/UserScript==

var onenote = function() {
        var jsCode = document.createElement('script');
        jsCode.setAttribute('src', 'https://www.onenote.com/clipper/root?ClipperId=ON-6a191eef-84a2-4491-9cc2-2e4560cfb9af&ClipperType=Bookmarklet&ClipperVersion=2.0.2');
        jsCode.setAttribute('id', 'oneNoteCaptureRootScript');
        jsCode.setAttribute('type', 'text/javascript');
        document.body.appendChild(jsCode);
    };
(function(){
document.addEventListener('keydown', function(e) {
  // pressed ctrl+alt+o
  if (e.keyCode == 79 && !e.shiftKey && e.ctrlKey && e.altKey && !e.metaKey) {
	  console.log("Clipper Hotkey Pressed")
  onenote(); // Open OneNote Clipper.
  }
}, false);
})();