Index: src/plugin/PluginUtil.cpp
diff --git a/src/plugin/PluginUtil.cpp b/src/plugin/PluginUtil.cpp
index fe7acb6b7c81194819966308eab9b1cef9238f4b..aeb19f6f28dfce10785c12f05f2efc8f60822760 100644
--- a/src/plugin/PluginUtil.cpp
+++ b/src/plugin/PluginUtil.cpp
@@ -1,20 +1,20 @@
-/*
- * This file is part of Adblock Plus <https://adblockplus.org/>,
- * Copyright (C) 2006-2015 Eyeo GmbH
- *
- * Adblock Plus is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 3 as
- * published by the Free Software Foundation.
- *
- * Adblock Plus is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Adblock Plus.  If not, see <http://www.gnu.org/licenses/>.
- */
-
+/*
+ * This file is part of Adblock Plus <https://adblockplus.org/>,
+ * Copyright (C) 2006-2015 Eyeo GmbH
+ *
+ * Adblock Plus is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3 as
+ * published by the Free Software Foundation.
+ *
+ * Adblock Plus is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Adblock Plus.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
 #include "PluginStdAfx.h"
 #include <algorithm>
 #include <stdexcept>
@@ -45,3 +45,13 @@ std::wstring FileUrl(const std::wstring& path)
   std::replace(url.begin(), url.end(), L'\\', L'/');
   return L"file:///" + url;
 }
+
+std::wstring GetLocationUrl(IWebBrowser2& browser)
+{
+  ATL::CComBSTR locationUrl;
+  if (FAILED(browser.get_LocationURL(&locationUrl)) || !locationUrl)
+  {
+    return std::wstring();
+  }
+  return std::wstring(locationUrl, locationUrl.Length());
+}
\ No newline at end of file
