You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the CSS plugin, Inject should adjust non-qualified URLs to make sure they're pointing to the correct path.
e.g. if my CSS file contains a relative image page, the Injected CSS file should respect the relative path of the origin CSS file, not the page it's being injected into.
// where:// `resolvedPath` is the path to the CSS module we XHR// e.g. `http://www.licdn.com/scds/concat/common/css?f=scss/some/file`// `content` is the body of the CSS module// matches non-qualified `url()` notations within the content// includes AlphaImageLoader(src="...")// excludes any fully qualified URLs, scheme-less URLs, or URIs with valid protocolsvarrNonQualifiedUrl=/((?:url\s*\(|AlphaImageLoader\s*\(\s*src\s*=)\s*['"]?(?!\/\/|[a-z]+\:))(.)/igm;// matches up to the pathname of the URLvarrBasePath=/(?:^(?:https?\:)?\/\/[^\/\?\#]+)/i;// matches any extraneous query/hash info that isn't relevant to URL path resolutionvarrQueryOrHash=/\/?[\?\#].*/;// strip off any query or hash on the file path stringvarbasePath=resolvedPath.replace(rQueryOrHash,'');// the fully qualified path to the host (excluding any pathname, hash, query)varhostPath=rBasePath.exec(resolvedPath)[0];// adjust any non-qualified URLs in the contentcontent.replace(rNonQualifiedUrl,function(){varresult=arguments[1];if(arguments[2][0]==='/'){result+=hostPath+arguments[2];}else{result+=basePath+'/'+arguments[2]}returnresult;});
some expectations, assuming the resolvedPath to the CSS module was: http://cdn.server.com/path/to/my.css
When using the CSS plugin, Inject should adjust non-qualified URLs to make sure they're pointing to the correct path.
e.g. if my CSS file contains a relative image page, the Injected CSS file should respect the relative path of the origin CSS file, not the page it's being injected into.
some expectations, assuming the resolvedPath to the CSS module was:
http://cdn.server.com/path/to/my.css
The text was updated successfully, but these errors were encountered: