<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Vanessa Jimenez on Medium]]></title>
        <description><![CDATA[Stories by Vanessa Jimenez on Medium]]></description>
        <link>https://medium.com/@vanessajimenez_85032?source=rss-6be93e690ca6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*vOpwh3O3B5u7oBcf.</url>
            <title>Stories by Vanessa Jimenez on Medium</title>
            <link>https://medium.com/@vanessajimenez_85032?source=rss-6be93e690ca6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 18:57:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vanessajimenez_85032/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Chrome Extensions: Content Scripts vs. Background Scripts]]></title>
            <link>https://medium.com/@vanessajimenez_85032/chrome-extensions-content-scripts-vs-background-scripts-7bbd01f9dbe6?source=rss-6be93e690ca6------2</link>
            <guid isPermaLink="false">https://medium.com/p/7bbd01f9dbe6</guid>
            <category><![CDATA[chrome-extension]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Vanessa Jimenez]]></dc:creator>
            <pubDate>Tue, 30 Jan 2018 03:36:09 GMT</pubDate>
            <atom:updated>2018-01-30T03:36:09.723Z</atom:updated>
            <content:encoded><![CDATA[<p>If you want to make your own Chrome Extension and are new to the Chrome Extension API this may be helpful article for you. Based on my own experience of building my first extension, it would have been helpful to have an article similar to this to help me through understanding how to properly use the Chrome Extension tools available through the API, primarily understanding the difference between Content Scripts and Background/Event Scripts.</p><p><strong>Content Scripts</strong></p><p>These are simply JavaScript files that run in the context of the web page you are currently on. In other words, you are capable of retrieving details from web pages or make changes to them. For example, if you want to write a function that simple console.logs any details about your web page, such as the the window location, this function would be written in your content script. The console log would then appear in the Chrome Developer Tools Javascript console.</p><p>To use the the Javascript Content Script file, declare it as follows in the manifest.json:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/0*Ej22OusGEa742U5q." /></figure><p>The “matches” property is important if you want your script to run with only specific web pages. There are multiple other properties you can apply listed <a href="https://developer.chrome.com/extensions/content_scripts">here</a>.</p><p><strong>Background Scripts</strong></p><p>These are two types of background scripts that can be used depending on the type of extension you are building. A persistent background page exists during the lifetime of the extension and only one instance of it actively running in the background of the Chrome browser waiting for the user to interact with the extension. The background page can be used to maintain state and acts as a controller for the rest of the extensions UI pages. An event page is another form of a background script that is initially run, but then once the script goes idle it is unloaded and is only loaded again when it is needed, usually this is the case in response to some event. Essentially, this just tells Chrome not to keep the background page loaded in memory all the time.</p><p>For example, if you want to write a function that simple console.logs any details about your extension, such as any information saved to local storage, this function would be written in your background script. The console log would then appear in the Chrome Developer Tools Javascript console pertaining specifically to the popup. This can be done by right clicking on your extension’s icon and inspecting the popup.</p><p>To use the background file, declare it as follows in the manifest.json file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/0*TN_nUzfSR92FD-Zs." /></figure><p>Hopefully this helps clarify the distinction between the two types of scripts when you are building out your amazing new chrome extension. Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7bbd01f9dbe6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>