Skip to content

@match with *. prefixing hostname should match hosts without subdomains #107

Description

@vassudanagunta

For example, the following script works for Google search results but not for DuckDuckGo's because Google results are returned on www.google.com while DDG's are on duckduckgo.com.

/* ==UserStyle==
@name        red visited search results
@description turn visited search results red
@match       *://*.duckduckgo.com/*
@match       *://*.google.com/*
==/UserStyle== */
:visited {
    color: red !important;
}

The workaround is to change the match pattern to @match *://duckduckgo.com/*, but:

  1. This contravenes the rules for match patterns (as required by Userscripts):

    If the host is *.hostname, then it matches the specified host or any of its subdomains.

  2. Makes the script dependent on Duckduckgo not adding a subdomain in the future.

System Information:

macOS version: 11.2.1
Userscripts version: 3.0.2
Safari version: 14.0.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions