Index: lib/elemHide.js
===================================================================
--- a/lib/elemHide.js
+++ b/lib/elemHide.js
@@ -18,17 +18,17 @@
 "use strict";
 
 /**
  * @fileOverview Element hiding implementation.
  */
 
 const {ElemHideExceptions} = require("./elemHideExceptions");
 const {filterNotifier} = require("./filterNotifier");
-const {suffixes} = require("./domain");
+const {normalizeHostname, suffixes} = require("./domain");
 
 /**
  * The maximum number of selectors in a CSS rule. This is used by
  * <code>{@link createStyleSheet}</code> to split up a long list of selectors
  * into multiple rules.
  * @const {number}
  * @default
  */
@@ -393,20 +393,17 @@
    *   list of selectors.
    */
   generateStyleSheetForDomain(domain, specificOnly = false,
                               includeSelectors = false)
   {
     let code = null;
     let selectors = null;
 
-    if (domain[domain.length - 1] == ".")
-      domain = domain.replace(/\.+$/, "");
-
-    domain = domain.toLowerCase();
+    domain = normalizeHostname(domain);
 
     if (specificOnly)
     {
       selectors = getConditionalSelectors(domain, true);
       code = createStyleSheet(selectors);
     }
     else
     {
