Closed bpierre closed 12 years ago
Sometimes, you don’t want to target a whole domain, but only a path.
You could add this to the documentation:
You can use the @-moz-document Mozilla Extension:
@-moz-document
/* Full path */ @-moz-document url-prefix(http://www.w3.org/Style/) { /* CSS here */ } /* Regex */ @-moz-document regexp("^https?:\/\/www\.w3\.org\/Style\/.*") { /* CSS here */ }
Documentation: https://developer.mozilla.org/en/CSS/@-moz-document
You can test the window.location object:
window.location
// Search for a string if (window.location.pathname.indexOf('/Style/') === 0) { // JS here } // Regex if (/^\/Style\/.*/.test(window.location.pathname)) { // JS here }
Documentation: https://developer.mozilla.org/en/DOM/window.location
I like!
Landed 7d003c04205b6c1ca51c9c35f7745fd6eeb18280
Thanks!
Sometimes, you don’t want to target a whole domain, but only a path.
You could add this to the documentation:
How to target a specific path
CSS
You can use the
@-moz-document
Mozilla Extension:Documentation: https://developer.mozilla.org/en/CSS/@-moz-document
JavaScript
You can test the
window.location
object:Documentation: https://developer.mozilla.org/en/DOM/window.location