{"id":2625,"date":"2022-05-18T08:42:54","date_gmt":"2022-05-18T05:42:54","guid":{"rendered":"https:\/\/www.etemkeskin.com\/?p=2625"},"modified":"2022-05-18T08:59:16","modified_gmt":"2022-05-18T05:59:16","slug":"doviz-kurunu-hesaplayan-chrome-eklentisi-gelistirme","status":"publish","type":"post","link":"https:\/\/www.etemkeskin.com\/index.php\/tr\/2022\/05\/18\/doviz-kurunu-hesaplayan-chrome-eklentisi-gelistirme\/","title":{"rendered":"D\u00f6viz Kurunu Hesaplayan Chrome Eklentisi Geli\u015ftirme"},"content":{"rendered":"\n<p>Bu yaz\u0131da <strong>Chrome \u0130nternet Taray\u0131c\u0131s\u0131 <\/strong>i\u00e7in geli\u015ftirdi\u011fim D\u00f6viz kurunu T\u00fcrk Liras\u0131na \u00e7evirme eklentisini anlataca\u011f\u0131m. <\/p>\n\n\n\n<p>Ziyaret edilen web sitesinde se\u00e7ilen dolar de\u011ferini g\u00fcncel kur de\u011feri ile TL&#8217; ye \u00e7eviren eklenti a\u015fa\u011f\u0131daki resimdeki gibi \u00e7al\u0131\u015fmaktad\u0131r. Bu eklenti \u00f6zellikle sat\u0131n alaca\u011f\u0131m\u0131z \u00fcr\u00fcnlerde fiyat de\u011ferlendirmesi yaparken olduk\u00e7a faydal\u0131 olacakt\u0131r.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" width=\"534\" height=\"598\" src=\"https:\/\/www.etemkeskin.com\/wp-content\/uploads\/2022\/05\/extension_img.png\" alt=\"\" class=\"wp-image-2614\"\/><\/figure><\/div>\n\n\n\n<p>A\u015fa\u011f\u0131daki resimde projenin dosya yap\u0131s\u0131 yer almaktad\u0131r.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" width=\"208\" height=\"415\" src=\"https:\/\/www.etemkeskin.com\/wp-content\/uploads\/2022\/05\/image.png\" alt=\"\" class=\"wp-image-2616\"\/><figcaption>proje yap\u0131s\u0131<\/figcaption><\/figure><\/div>\n\n\n\n<p>Projenin <strong>manifest.json<\/strong> dosyas\u0131; <strong>Options.html<\/strong> ve <strong>popup.html<\/strong> dosyalar\u0131 bu projede kullan\u0131lmad\u0131. Daha sonraki projelerde kullan\u0131lmak \u00fczere template olarak b\u0131rak\u0131ld\u0131.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;application\/json&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;showPanel&quot;:false,&quot;language&quot;:&quot;JSON&quot;,&quot;modeName&quot;:&quot;json&quot;}\">{\n  &quot;name&quot;: &quot;Convert value&quot;,\n  &quot;version&quot;: &quot;1.0.0&quot;,\n  &quot;manifest_version&quot;: 2,\n\n  &quot;description&quot;: &quot;Convert values&quot;,\n\n  &quot;minimum_chrome_version&quot;: &quot;35&quot;,\n\n  &quot;icons&quot;: {\n    &quot;16&quot;: &quot;icons\/icon16.png&quot;,\n    &quot;48&quot;: &quot;icons\/icon48.png&quot;,\n    &quot;128&quot;: &quot;icons\/icon128.png&quot;\n  },\n\n  &quot;options_page&quot;: &quot;options.html&quot;,\n\n  &quot;background&quot;: {\n    &quot;scripts&quot;: [&quot;.\/background\/background.js&quot;],\n    &quot;persistent&quot;: false\n  },\n\n  &quot;browser_action&quot;: {\n    &quot;default_popup&quot;: &quot;.\/popup.html&quot;\n  },\n\n  &quot;content_scripts&quot;: [\n    {\n      &quot;matches&quot;: [&quot;*:\/\/*\/*&quot;],\n      &quot;js&quot;: [\n        &quot;script.js&quot;\n      ],\n      &quot;css&quot;: [\n        &quot;style.css&quot;\n      ],\n      &quot;all_frames&quot;: true\n    }\n  ],\n\n  &quot;permissions&quot;: [\n    &quot;contextMenus&quot;,\n    &quot;notifications&quot;,\n    &quot;clipboardWrite&quot;,\n    &quot;tabs&quot;,\n    &quot;activeTab&quot;\n  ]\n}\n<\/pre><\/div>\n\n\n\n<p><strong>background.js<\/strong> dosyas\u0131 a\u015fa\u011f\u0131daki gibidir. API&#8217; den elde edece\u011fimiz g\u00fcncel kur bilgisini CORS&#8217; a tak\u0131lmamak i\u00e7in background.js&#8217; de fetch apisi ile \u00e7ektik.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text\/javascript&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;showPanel&quot;:false,&quot;language&quot;:&quot;JavaScript&quot;,&quot;modeName&quot;:&quot;js&quot;}\">chrome.runtime.onMessage.addListener(\n    function(url, sender, onSuccess) {\n        fetch(url)\n            .then(response =&gt; response.json())\n            .then(responseText =&gt; onSuccess(responseText))\n        \n        return true;  \/\/ Will respond asynchronously.\n    }\n);<\/pre><\/div>\n\n\n\n<p><strong>style.css<\/strong> dosyas\u0131nda, ziyaret edilen sayfada d\u00f6viz tutar\u0131 se\u00e7ildikten sonra \u00e7\u0131kacak popup&#8217; \u0131n <strong>style<\/strong> bilgilerini tan\u0131mlad\u0131k. <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;css&quot;,&quot;mime&quot;:&quot;text\/css&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;showPanel&quot;:false,&quot;language&quot;:&quot;CSS&quot;,&quot;modeName&quot;:&quot;css&quot;}\">#popup_converter8255 {\n    background-color: #FFF;\n    width: 170px;\n    height: 90px;\n    color: #8f9cb5;\n    font-size: 18px;\n    display: inline-block;\n    padding-top: 5px;\n    padding-right: 5px;\n    padding-bottom: 5px;\n    padding-left: 5px;\n    border: 3px solid;\n    border-color: #9AD3DE;\n    border-radius: 5px;\n    display: none;\n  }<\/pre><\/div>\n\n\n\n<p><strong>script.js<\/strong> dosyas\u0131nda popup&#8217; \u0131n \u00e7al\u0131\u015fma loji\u011fini koda d\u00f6kt\u00fck.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text\/javascript&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;showPanel&quot;:false,&quot;language&quot;:&quot;JavaScript&quot;,&quot;modeName&quot;:&quot;js&quot;}\">function getSelectedText() {\n  var text = &quot;&quot;;\n  if (typeof window.getSelection != &quot;undefined&quot;) {\n    text = window.getSelection().toString();\n  } else if (\n    typeof document.selection != &quot;undefined&quot; &amp;&amp;\n    document.selection.type == &quot;Text&quot;\n  ) {\n    text = document.selection.createRange().text;\n  }\n  return text;\n}\n\nfunction doSomethingWithSelectedText(e) {\n  var selectedText = getSelectedText();\n  if (!selectedText.toString().trim().length) {\n    removePopup();\n    return;\n  }\n\n  if (selectedText &amp;&amp; isNumeric(selectedText)) {\n    const x = e.clientX;\n    const y = e.clientY;\n    const currencyVal = getCurrency();\n    const calculatedCurrency = calculateCurrency(currencyVal, selectedText); \n\n    placePopup(x, y, calculatedCurrency);\n  }\n}\n\nlet currValueofFetchData;\n\nfunction getCurrency() {\n    const url = &quot;http:\/\/hasanadiguzel.com.tr\/api\/kurgetir&quot;;\/\/ free currency rate api\n    \n    chrome.runtime.sendMessage( \/\/goes to bg_page.js\n        url,\n        data =&gt; {\n          currValueofFetchData = data.TCMB_AnlikKurBilgileri[0].BanknoteSelling;\n        }\n    );\n    currValueofFetchData = parseFloat(currValueofFetchData);\n    return currValueofFetchData;\n}\n\nfunction calculateCurrency(currencyVal, selectedText) {\n    return currencyVal*selectedText;\n}\n\nfunction isNumeric(n) {\n  return !isNaN(parseFloat(n)) &amp;&amp; isFinite(n);\n}\n\nfunction placePopup(x_pos, y_pos, calculatedCurrency) {\n  const d = document.getElementById(&quot;popup_converter8255&quot;);\n  d.style.position = &quot;fixed&quot;;\n  d.style.left = x_pos + &quot;px&quot;;\n  d.style.top = y_pos + &quot;px&quot;;\n  d.innerText = calculatedCurrency.toFixed(2) + &quot; TL&quot;;\n  d.style.display = &quot;block&quot;;\n\n}\n\nfunction removePopup() {\n  const d = document.getElementById(&quot;popup_converter8255&quot;);\n  d.style.display = &quot;none&quot;;\n}\n\nfunction createPopupElement() {\n  const popup8255 = document.createElement(&quot;div&quot;);\n  if (popup8255.length &lt; 0) {\n    return;\n  }\n  popup8255.setAttribute(&quot;id&quot;, &quot;popup_converter8255&quot;);\n  document.body.appendChild(popup8255);\n}\n\nsetTimeout(createPopupElement, 1000);\n\ndocument.onmouseup = doSomethingWithSelectedText;\n<\/pre><\/div>\n\n\n\n<p>Sizde web sitelerini gezerken verimlili\u011finizi art\u0131racak b\u00f6yle eklentiler geli\u015ftirebilirsiniz.<\/p>\n\n\n\n<p>Ba\u015far\u0131lar dilerim&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bu yaz\u0131da Chrome \u0130nternet Taray\u0131c\u0131s\u0131 i\u00e7in geli\u015ftirdi\u011fim D\u00f6viz kurunu T\u00fcrk Liras\u0131na \u00e7evirme eklentisini anlataca\u011f\u0131m. Ziyaret edilen web sitesinde se\u00e7ilen dolar de\u011ferini g\u00fcncel kur de\u011feri ile TL&#8217; ye \u00e7eviren eklenti a\u015fa\u011f\u0131daki resimdeki gibi \u00e7al\u0131\u015fmaktad\u0131r. Bu eklenti \u00f6zellikle sat\u0131n alaca\u011f\u0131m\u0131z \u00fcr\u00fcnlerde fiyat de\u011ferlendirmesi yaparken olduk\u00e7a faydal\u0131 olacakt\u0131r. A\u015fa\u011f\u0131daki resimde projenin dosya yap\u0131s\u0131 yer almaktad\u0131r. Projenin manifest.json dosyas\u0131; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[18,52],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>D\u00f6viz Kurunu Hesaplayan Chrome Eklentisi Geli\u015ftirme - blog website<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.etemkeskin.com\/index.php\/tr\/2022\/05\/18\/doviz-kurunu-hesaplayan-chrome-eklentisi-gelistirme\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"D\u00f6viz Kurunu Hesaplayan Chrome Eklentisi Geli\u015ftirme - blog website\" \/>\n<meta property=\"og:description\" content=\"Bu yaz\u0131da Chrome \u0130nternet Taray\u0131c\u0131s\u0131 i\u00e7in geli\u015ftirdi\u011fim D\u00f6viz kurunu T\u00fcrk Liras\u0131na \u00e7evirme eklentisini anlataca\u011f\u0131m. Ziyaret edilen web sitesinde se\u00e7ilen dolar de\u011ferini g\u00fcncel kur de\u011feri ile TL&#8217; ye \u00e7eviren eklenti a\u015fa\u011f\u0131daki resimdeki gibi \u00e7al\u0131\u015fmaktad\u0131r. Bu eklenti \u00f6zellikle sat\u0131n alaca\u011f\u0131m\u0131z \u00fcr\u00fcnlerde fiyat de\u011ferlendirmesi yaparken olduk\u00e7a faydal\u0131 olacakt\u0131r. A\u015fa\u011f\u0131daki resimde projenin dosya yap\u0131s\u0131 yer almaktad\u0131r. Projenin manifest.json dosyas\u0131; [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.etemkeskin.com\/index.php\/tr\/2022\/05\/18\/doviz-kurunu-hesaplayan-chrome-eklentisi-gelistirme\/\" \/>\n<meta property=\"og:site_name\" content=\"blog website\" \/>\n<meta property=\"article:published_time\" content=\"2022-05-18T05:42:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-05-18T05:59:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.etemkeskin.com\/wp-content\/uploads\/2022\/05\/extension_img.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Tahmini okuma s\u00fcresi\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 dakika\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.etemkeskin.com\/#website\",\"url\":\"https:\/\/www.etemkeskin.com\/\",\"name\":\"blog website\",\"description\":\"Etem KESK\\u0130N\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/www.etemkeskin.com\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"tr\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.etemkeskin.com\/index.php\/tr\/2022\/05\/18\/doviz-kurunu-hesaplayan-chrome-eklentisi-gelistirme\/#primaryimage\",\"inLanguage\":\"tr\",\"url\":\"https:\/\/www.etemkeskin.com\/wp-content\/uploads\/2022\/05\/extension_img.png\",\"contentUrl\":\"https:\/\/www.etemkeskin.com\/wp-content\/uploads\/2022\/05\/extension_img.png\",\"width\":534,\"height\":598},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.etemkeskin.com\/index.php\/tr\/2022\/05\/18\/doviz-kurunu-hesaplayan-chrome-eklentisi-gelistirme\/#webpage\",\"url\":\"https:\/\/www.etemkeskin.com\/index.php\/tr\/2022\/05\/18\/doviz-kurunu-hesaplayan-chrome-eklentisi-gelistirme\/\",\"name\":\"D\\u00f6viz Kurunu Hesaplayan Chrome Eklentisi Geli\\u015ftirme - blog website\",\"isPartOf\":{\"@id\":\"https:\/\/www.etemkeskin.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.etemkeskin.com\/index.php\/tr\/2022\/05\/18\/doviz-kurunu-hesaplayan-chrome-eklentisi-gelistirme\/#primaryimage\"},\"datePublished\":\"2022-05-18T05:42:54+00:00\",\"dateModified\":\"2022-05-18T05:59:16+00:00\",\"author\":{\"@id\":\"https:\/\/www.etemkeskin.com\/#\/schema\/person\/dcbc30282861ce578b96a79ce8789629\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.etemkeskin.com\/index.php\/tr\/2022\/05\/18\/doviz-kurunu-hesaplayan-chrome-eklentisi-gelistirme\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.etemkeskin.com\/index.php\/tr\/2022\/05\/18\/doviz-kurunu-hesaplayan-chrome-eklentisi-gelistirme\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.etemkeskin.com\/index.php\/tr\/2022\/05\/18\/doviz-kurunu-hesaplayan-chrome-eklentisi-gelistirme\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Ana sayfa\",\"item\":\"https:\/\/www.etemkeskin.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"D\\u00f6viz Kurunu Hesaplayan Chrome Eklentisi Geli\\u015ftirme\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.etemkeskin.com\/#\/schema\/person\/dcbc30282861ce578b96a79ce8789629\",\"name\":\"etemkeskin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.etemkeskin.com\/#personlogo\",\"inLanguage\":\"tr\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6af0148b790691ed24ae245fb3dc773b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6af0148b790691ed24ae245fb3dc773b?s=96&d=mm&r=g\",\"caption\":\"etemkeskin\"},\"url\":\"https:\/\/www.etemkeskin.com\/index.php\/author\/etemkeskinyahoo-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/posts\/2625"}],"collection":[{"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/comments?post=2625"}],"version-history":[{"count":7,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/posts\/2625\/revisions"}],"predecessor-version":[{"id":2648,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/posts\/2625\/revisions\/2648"}],"wp:attachment":[{"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/media?parent=2625"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/categories?post=2625"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/tags?post=2625"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}