Google Drive Preview Link button

Create a button to go to the preview link in the Google Drive File link.

À partir de 2021-01-16. Voir la dernière version.

// ==UserScript==
// @name         Google Drive Preview Link button
// @name:ko      구글드라이브 미리보기 링크 버튼
// @version      0.1
// @description  Create a button to go to the preview link in the Google Drive File link.
// @description:ko   구글드라이브 파일링크에서 미리보기 링크로 이동하는 버튼을 만듭니다.
// @author       Meda
// @match        https://drive.google.com/u*
// @grant        none
// @namespace https://greasyfork.dpdns.org/users/319515
// ==/UserScript==

function getLang() {
  var userLang = navigator.language || navigator.userLanguage;
  return userLang;
}

(function() {
    var array = window.location.href.split("?id=");
    var elem = document.getElementById('uc-text');
    var newLink = document.createElement("a");

    newLink.setAttribute('id', 'uc-download-link');
    newLink.setAttribute('class', 'goog-inline-block jfk-button jfk-button-action');
    newLink.href = "https://drive.google.com/file/d/"+array[1].substr(0, 33)+"/edit";
    if(getLang()=="ko-KR"){
        newLink.innerHTML = '미리보기';
    }else{
        newLink.innerHTML = 'Preview';
    }
    elem.append(newLink);
})();

长期地址
遇到问题?请前往 GitHub 提 Issues,或加Q群1031348184

赞助商

Fishcpy

广告

Rainyun

注册一下就行

Rainyun

一年攒够 12 元