상세 컨텐츠

본문 제목

[인터넷] 구글 스프레드시트 보기 전용 해제하기

1. 소프트웨어/1.4. 인터넷

by 창민 2022. 2. 5. 20:51

본문

<구글 스프레드시트 보기 전용 1>
<구글 스프레드시트 보기 전용 2>

'보기 전용'으로 만들어진 구글 스프레드시트는 복사, 인쇄, 사본 만들기 등이 모두 제한된다. 하지만 미리 보기 트릭으로 이를 뚫을 수 있다. 이렇게 만든 스프레드시트 미리 보기는 셀 서식까지 복사하여 사용할 수 있지만 함수는 복사가 안 된다.
소개하는 방법은 두 가지로 둘 모두 결과물의 내용은 동일하지만 편리성의 방향이 다르다. 각자 필요에 맞게 사용하면 된다.

1. [수동] 구글 스프레드시트 보기 전용 해제

https://docs.google.com/spreadsheets/d/링크ID/edit#gid=0000000000
https://docs.google.com/spreadsheets/d/링크ID/preview

 

2. [스크립트] 구글 스프레드시트 보기 전용 해제

1. 아무 링크나 북마크에 추가한다. 이름은 "Copy G Sheet v1.0" 입력한다. *필요하면 아무거나 해도 상관없음
2. 추가된 북마크 우클릭 → 편집 → URL에 아래 스크립트를 복붙한다.

javascript:(function()%7Bvar host%3Dwindow.location.host%3Bif("docs.google.com"!%3Dhost)alert("Not a valid Google Spreadsheet")%3Belse%7Bvar url%3Dwindow.location.href%2CresultURL%3D""%2CresultError%3D""%2Cprotocol%3Dwindow.location.protocol%2Cparts%3Dwindow.location.pathname.split("%2F")%2CdocType%3D""%2Cheading%3Ddocument.createElement("h4")%3Bif(heading.innerHTML%3D"Copyable Google Sheet"%2C5%3D%3Dparts.length%26%26"edit"%3D%3Dparts%5B4%5D)%7Bvar docId%3Dparts%5B3%5D%3B-1!%3Dparts.indexOf("document")%3F(docType%3D"document"%2Cheading.innerHTML%3D"Copyable Google Document")%3A-1!%3Dparts.indexOf("spreadsheets")%3F(docType%3D"spreadsheets"%2Cheading.innerHTML%3D"Copyable Google Sheet")%3A-1!%3Dparts.indexOf("presentation")%26%26(docType%3D"presentation"%2Cheading.innerHTML%3D"Copyable Google Presentation")%2C""!%3DdocId%26%26""!%3DdocType%3F(resultURL%3Dprotocol%2B"%2F%2F"%2Bhost%2B"%2F"%2BdocType%2B"%2Fu%2F1%2Fd%2F"%2BdocId%2B"%2Fpreview"%2CresultError%3D"")%3AresultError%3D"Unable to generate preview URL"%7Delse 8%3D%3Dparts.length%26%26"preview"%3D%3Dparts%5B6%5D%3F(resultError%3D""%2CresultURL%3Dwindow.location.href.substring(0%2Cwindow.location.href.lastIndexOf("%2Fpreview"))%2B"%2Fpreview")%3AresultError%3D"Not a valid Google Document"%3Bif("spreadsheets"!%3DdocType)alert("Not a valid Google Spreadsheet")%3Belse%7Bvar bookmarklet_version%3D"1.0"%2Cstyle%3Ddocument.createElement("style")%3Bstyle.innerHTML%3D"%23supple-gsheetlink-bookmarklet-4526 %7Bfont-family%3A sans-serif%3Bmargin%3A 0%3Bcolor%3A %230f0f0f%3Bpadding%3A 0%3Bborder%3A 0%3Bfont-size%3A 100%25%3Bfont%3A inherit%3Bvertical-align%3A baseline%3Bposition%3A fixed%3Bbackground-color%3Awhite%3Bwidth%3A600px%3Bfont-size%3A12px%3Bright%3A 5px%3Bborder-width%3A 1px%3Bborder-style%3A solid%3Bborder-color%3A rgb(169%2C 169%2C 169)%3Bborder-image%3A initial%3Bpadding%3A 15px%3Bbottom%3A 5px%3Bz-index%3A "%2BNumber.MAX_SAFE_INTEGER%2B"%3B%7D%23supple-gsheetlink-bookmarklet-4526 h4 %7Bfont-family%3A sans-serif%3Bpadding%3A 0%3Bfont-size%3A 20px%3Bfont-weight%3A 600%3Bmargin%3A 0%3B%7D%23supple-gsheetlink-bookmarklet-close-4526 %7Bdisplay%3A block%3Bposition%3A absolute%3Btop%3A 0px%3Bpadding%3A 8px 10px%3Bright%3A 0px%3Bcursor%3A pointer%3Bfont-size%3A 11px%3Bfont-weight%3A bold%3B%7D%23supple-gsheetlink-bookmarklet-4526 >div %7Bfont-family%3A sans-serif%3Bpadding%3A 15px 0%3B%7D%23supple-gsheetlink-bookmarklet-4526 >div>div>div %7Bfont-family%3A sans-serif%3Bfont-size%3A11px%3B%7D%23supple-gsheetlink-bookmarklet-4526 button %7Bfont-family%3A sans-serif%3Bpadding%3A 5px%3Bmargin%3A 10px 0%3Bfont-size%3A12px%3Bcolor%3A %23fff%3Bbackground-color%3A %230095ff%3Bborder-color%3A %230095ff%3B%7D%23supple-gsheetlink-bookmarklet-4526 button.moreOptions %7Bfont-family%3A sans-serif%3Bpadding%3A 5px%3Bfloat%3A right%3Bmargin%3A 0%3Bcolor%3A %230095ff%3Bbackground-color%3A %23fff%3Bborder-color%3A %230095ff%3B%7D%23supple-gsheetlink-bookmarklet-result-4526 %7Bdisplay%3A none%3B%7D%23supple-gsheetlink-bookmarklet-adv-4526 %7Bclear%3A both%3B%7D.supple-gsheetlink-bookmarklet-adv-container %7Bfont-family%3A sans-serif%3Bmargin%3A 5px 0%3Bpadding%3A 5px 0%3B%7D.supple-gsheetlink-bookmarklet-label %7Bfont-family%3A sans-serif%3Bfloat%3A none%3Bfont-size%3A12px%3Bwidth%3A 100px%3Bdisplay%3A inline-block%3B%7D.supple-gsheetlink-bookmarklet-input input %7Bfont-family%3A sans-serif%3Bfont-size%3A12px%3Bwidth%3A 100%25%3B%7D%23supple-gsheetlink-bookmarklet-credit-4526 %7Bclear%3A both%3Btext-align%3A center%3B%7D%23supple-gsheetlink-bookmarklet-credit-4526 img %7Bvertical-align%3A middle%3Bmargin%3A 0 10px%3B%7D%23supple-gsheetlink-bookmarklet-credit-4526 a.moreinfo%7Bright%3A 20px%3Bvertical-align%3A bottom%3Bposition%3A absolute%3Bbottom%3A 10px%3B%7D%23supple-gsheetlink-bookmarklet-link-1%2C %23supple-gsheetlink-bookmarklet-link-2%7Bpadding%3A 10px 0%3Boverflow%3A hidden%3B%7D%23supple-gsheetlink-bookmarklet-link-1 a%2C %23supple-gsheetlink-bookmarklet-link-2 a%7Bcolor%3A %230095ff%3B%7D.supple-gsheetlink-bookmarklet-input %7Bfont-family%3A sans-serif%3Bfont-size%3A12px%3Bfloat%3A right%3Bdisplay%3A inline-block%3Bwidth%3A 70%25%3Bwidth%3A calc(100%25 - 120px)%3B%7D%40media (max-width%3A 768px)%7B%23supple-gsheetlink-bookmarklet-4526 %7Bmax-width%3A 100%25%3Bmax-width%3A calc(100%25 - 10px)%3B%7D%7D"%3Bvar removeBookmarkletPanel%3Dfunction()%7Bpanel%3Ddocument.getElementById("supple-gsheetlink-bookmarklet-4526")%2Cpanel%26%26panel.parentNode.removeChild(panel)%7D%3Bfunction copyToClipboard(e)%7Bvar o%3Ddocument.createElement("textarea")%3Bdocument.body.appendChild(o)%2Co.value%3De%2Co.select()%2Cdocument.execCommand("copy")%2Cdocument.body.removeChild(o)%7DremoveBookmarkletPanel()%3Bvar copyClickEvent%3Dfunction()%7BcopyToClipboard(this.getAttribute("link"))%3Bvar e%3Dthis%3Bconsole.log("Copied%3A "%2Bthis.getAttribute("link"))%2Ce.childNodes%5B0%5D.nodeValue%3D"Copied"%2CsetTimeout(function()%7Be.childNodes%5B0%5D.nodeValue%3D"Copy Link"%7D%2C500)%7D%2CcopyBtn%3Ddocument.createElement("button")%3BcopyBtn.innerHTML%3D"Copy Link"%2CcopyBtn.addEventListener("click"%2CcopyClickEvent)%3Bvar renderResult%3Dfunction(e%2Co%2Ct)%7Bif(void 0%3D%3D%3Do%26%26(o%3D"")%2Cvoid 0%3D%3D%3Dt%26%26(t%3D"")%2Cconsole.log("link %5B"%2Bo%2B"%5D")%2Cconsole.log("error %5B"%2Bt%2B"%5D")%2C""%3D%3Do%26%26""%3D%3Dt)return!1%3Bconsole.log("renderResult link%3A "%2Bo%2B" error%3A "%2Bt)%3Bvar l%3Ddocument.getElementById("supple-gsheetlink-bookmarklet-link-1")%3Bl%7C%7C((l%3Ddocument.createElement("div")).id%3D"supple-gsheetlink-bookmarklet-link-1"%2Cl.style.display%3D"none")%3Bvar n%3DcopyBtn.cloneNode(!0)%3Bif(n.id%3D"supple-gsheetlink-bookmarklet-btn-1"%2Cn.onclick%3DcopyClickEvent%2C""%3D%3Do%26%26""!%3Dt)%7Bif(l.innerHTML%3D"<strong>Error%3A<%2Fstrong> "%2Bt%2Cl.style.display%3D"block"%2C!(i%3Ddocument.getElementById("supple-gsheetlink-bookmarklet-btn-1")))(i%3DcopyBtn.cloneNode(!0)).id%3D"supple-gsheetlink-bookmarklet-btn-1"%2Ci.onclick%3DcopyClickEvent%3Bi.style.display%3D"block"%2Ci.setAttribute("link"%2Co)%2Ce.appendChild(l)%7Delse%7Bvar i%3Bif(l.innerHTML%3D"<strong>Link%3A<%2Fstrong> <a target%3D'_blank' href%3D'"%2Bo%2B"'>"%2Bo%2B"<%2Fa>"%2Cl.style.display%3D"block"%2C!(i%3Ddocument.getElementById("supple-gsheetlink-bookmarklet-btn-1")))(i%3DcopyBtn.cloneNode(!0)).id%3D"supple-gsheetlink-bookmarklet-btn-1"%2Ci.onclick%3DcopyClickEvent%3Bi.style.display%3D"block"%2Ci.setAttribute("link"%2Co)%2Ce.appendChild(l)%2Ce.appendChild(i)%7De.style.display%3D"block"%7D%2CnewDiv%3Ddocument.createElement("div")%3BnewDiv.id%3D"supple-gsheetlink-bookmarklet-4526"%3Bvar closePanelBtn%3Ddocument.createElement("span")%3BclosePanelBtn.id%3D"supple-gsheetlink-bookmarklet-close-4526"%2CclosePanelBtn.addEventListener("click"%2CremoveBookmarkletPanel)%2CclosePanelBtn.innerHTML%3D"X"%3Bvar resultDiv%3Ddocument.createElement("div")%3Bif(resultDiv.id%3D"supple-gsheetlink-bookmarklet-result-4526"%2CresultDiv)%7BrenderResult(resultDiv%2CresultURL%2CresultError)%3Bvar creditDiv%3Ddocument.createElement("div")%3BcreditDiv.id%3D"supple-gsheetlink-bookmarklet-credit-4526"%2CcreditDiv.innerHTML%3D"Bookmarklet "%2Bbookmarklet_version%2B' by <a rel%3D"nofollow" target%3D"_blank" href%3D"https%3A%2F%2Fsupple.com.au%2F"><img width%3D"63" height%3D"28" src%3D"https%3A%2F%2Fsupple.com.au%2Fwp-content%2Fthemes%2Fsupple%2Fimages%2Flogo.png" title%3D"Supple"><%2Fa>%26nbsp%3B<a rel%3D"nofollow" href%3D"https%3A%2F%2Fsupple.com.au%2Ftools%2Fcopy-protected-google-sheets%2F" target%3D"_blank" class%3D"moreinfo">More Info %26 Tutorial<%2Fa>'%2CnewDiv.appendChild(heading)%2CnewDiv.appendChild(closePanelBtn)%2CnewDiv.appendChild(resultDiv)%2CnewDiv.appendChild(creditDiv)%2Cdocument.body.appendChild(newDiv)%2Cdocument.body.insertBefore(style%2CnewDiv)%2Cconsole.log("Result%3A %5B"%2Burl%2B"%5D")%7D%7D%7D%7D)()%3B

3. '보기 전용'을 해제하고자 하는 스프레드시트 사이트에서 방금 만든 Copy G Sheet v1.0를 클릭하면 인터넷 우측 하단에 미리 보기 링크가 생성된다. [Copy Link]를 눌러 새 탭에 붙여넣어 사용하면 된다.

 

참고 자료

관련글 더보기

댓글 영역