Remove text from JS File using a script

Viewed 617

I am trying to write a script that will delete a line of code if it exists in the js file already. I am curious if this is even possible. When the script runs i want it to check if user_pref("plugin.disable_full_page_plugin_for_types", "application/pdf"); exists and then delete it if it does. This exists almost 100% percent of the time. So I am interested in knowing if it is possible or a command to remove it if it exists.

cd /D "%APPDATA%\Mozilla\Firefox\Profiles\*.default"
echo user_pref("browser.cache.check_doc_frequency", 1);>>prefs.js
if (user_pref("plugin.disable_full_page_plugin_for_types", "application/pdf"); !== undefined) {

}

I guess the catch is the js file already exists so its not like I can set it to a variable and then set the variable to nothing.

Not sure if this is possible any help would be greatly appreciated!

2 Answers
Related