본문 바로가기

Computer/Chrome Extension

(5)
[Sample] Content Settings Content Settings 안녕하세요?오늘은 크롬에서 보여지는 웹페이즈를 컨트롤 할 수 있는 기능을 따라해보겠습니다. 위의 샘플을 따라해보았습니다. 네이버의 이미지들이 표현되지 않도록 block 하고 진행하였습니다. [ 컨텐츠 셋팅 SET ] chrome.contentSettings[type].set({ 'primaryPattern': pattern, 'setting': setting, 'scope': (incognito ? 'incognito_session_only' : 'regular') }); [ 컨텐츠 셋팅 GET ] chrome.contentSettings[type].get({ 'primaryUrl': url, 'incognito': incognito }, function(details) {..
[Sample] Print this page Print this page 샘플을 따라해보겠습니다. 사용되는 API 는 다음과 같습니다. - browserAction.onClicked : 우측 상단의 확장프로그램 아이콘 클릭시 발생하는 이벤트 캐치- tabs.update : 해당 tab를 특정 url 로 수정 [ 이벤트 디텍팅 ]chrome.browserAction.onClicked.addListener(function(tab){}); chrome.browserAction.onClicked.addListener(function(tab) { var action_url = "javascript:window.print();"; chrome.tabs.update(tab.id, {url: action_url});}); [ 탭 데이터 수정 ]chrome.tab..
[Sample] My Bookmarks 구글의 sample Extension 들을 하나하나 따라가 보겠습니다. 처음 따라가볼 예제는 My Bookmarks 입니다. 사용되는 API 목록은 다음과 같습니다. bookmarks.getTree : 크롬의 북마크로부터 데이터들을 가져옵니다.bookmarks.create : 크롬에 북마크를 추가합니다.bookmarks.remove : 크롬에 존재하는 북마크를 삭제합니다.bookmarks.update : 크롬에 존재하는 북마크를 tabs.create : 탭을 생성합니다. 각 API 별 사용 예시입니다. [ 북마크 가져오기 ]chrome.bookmarks.getTree(function(nodes){}); function dumpBookmarks(query) { var bookmarkTreeNodes = c..
크롬 확장 API 리스트 정리 크롬 확장 API 리스트 정리입니다. 리스트 추출은 Python 을 이용하였습니다.관련 타이틀을 클릭하시면 해당 샘플 소스를 받을수 있습니다.소스를 풀으셔서 크롬 확장 프로그램에 넣으시면 샘플이 동작합니다. My Bookmarks Page Redder Print this page A browser action which changes its icon when clicked A browser action with a popup that changes the page color BrowsingData API: Basics Sample Extension Commands extension Content settings Context Menus Sample Context Menus Sample (with Even..
OverView 기본적으로크롬확장프로그램은 HTML,CSS,JavaScript,Image 등과 같은 파일들의 압축이다.확장프로그램은 근본적으로는 웹페이지이다. 그리고 크롬 브라우저에서 제공하는 API 를 사용할 수 있다. Stable APIs NameDescriptionSince accessibilityFeatures Use the chrome.accessibilityFeatures API to manage Chrome's accessibility features. This API relies on the ChromeSetting prototype of the type API for getting and setting individual accessibility features. In order to get featur..