File tree Expand file tree Collapse file tree 10 files changed +319
-149
lines changed
Sources/ContentScopeScripts/dist Expand file tree Collapse file tree 10 files changed +319
-149
lines changed Original file line number Diff line number Diff line change 6014
6014
* @param {string} rules[].type
6015
6015
*/
6016
6016
function injectStyleTag (rules) {
6017
- const styleTag = document.createElement('style');
6017
+ const styleTag = document.createElement('link');
6018
+ styleTag.setAttribute('rel', 'stylesheet');
6019
+ styleTag.setAttribute('type', 'text/css');
6018
6020
let styleTagContents = '';
6019
6021
6020
6022
rules.forEach((rule, i) => {
6026
6028
});
6027
6029
6028
6030
styleTagContents = styleTagContents.concat('{display:none!important;min-height:0!important;height:0!important;}');
6029
- styleTag.innerText = styleTagContents;
6031
+ styleTag.href = 'data:text/css,' + encodeURIComponent( styleTagContents) ;
6030
6032
6031
6033
document.head.appendChild(styleTag);
6032
6034
}
Original file line number Diff line number Diff line change 6014
6014
* @param {string} rules[].type
6015
6015
*/
6016
6016
function injectStyleTag (rules) {
6017
- const styleTag = document.createElement('style');
6017
+ const styleTag = document.createElement('link');
6018
+ styleTag.setAttribute('rel', 'stylesheet');
6019
+ styleTag.setAttribute('type', 'text/css');
6018
6020
let styleTagContents = '';
6019
6021
6020
6022
rules.forEach((rule, i) => {
6026
6028
});
6027
6029
6028
6030
styleTagContents = styleTagContents.concat('{display:none!important;min-height:0!important;height:0!important;}');
6029
- styleTag.innerText = styleTagContents;
6031
+ styleTag.href = 'data:text/css,' + encodeURIComponent( styleTagContents) ;
6030
6032
6031
6033
document.head.appendChild(styleTag);
6032
6034
}
Original file line number Diff line number Diff line change 5948
5948
* @param {string} rules[].type
5949
5949
*/
5950
5950
function injectStyleTag (rules) {
5951
- const styleTag = document.createElement('style');
5951
+ const styleTag = document.createElement('link');
5952
+ styleTag.setAttribute('rel', 'stylesheet');
5953
+ styleTag.setAttribute('type', 'text/css');
5952
5954
let styleTagContents = '';
5953
5955
5954
5956
rules.forEach((rule, i) => {
5960
5962
});
5961
5963
5962
5964
styleTagContents = styleTagContents.concat('{display:none!important;min-height:0!important;height:0!important;}');
5963
- styleTag.innerText = styleTagContents;
5965
+ styleTag.href = 'data:text/css,' + encodeURIComponent( styleTagContents) ;
5964
5966
5965
5967
document.head.appendChild(styleTag);
5966
5968
}
Original file line number Diff line number Diff line change 6024
6024
* @param {string} rules[].type
6025
6025
*/
6026
6026
function injectStyleTag (rules) {
6027
- const styleTag = document.createElement('style');
6027
+ const styleTag = document.createElement('link');
6028
+ styleTag.setAttribute('rel', 'stylesheet');
6029
+ styleTag.setAttribute('type', 'text/css');
6028
6030
let styleTagContents = '';
6029
6031
6030
6032
rules.forEach((rule, i) => {
6036
6038
});
6037
6039
6038
6040
styleTagContents = styleTagContents.concat('{display:none!important;min-height:0!important;height:0!important;}');
6039
- styleTag.innerText = styleTagContents;
6041
+ styleTag.href = 'data:text/css,' + encodeURIComponent( styleTagContents) ;
6040
6042
6041
6043
document.head.appendChild(styleTag);
6042
6044
}
Original file line number Diff line number Diff line change 5927
5927
* @param {string} rules[].type
5928
5928
*/
5929
5929
function injectStyleTag (rules) {
5930
- const styleTag = document.createElement('style');
5930
+ const styleTag = document.createElement('link');
5931
+ styleTag.setAttribute('rel', 'stylesheet');
5932
+ styleTag.setAttribute('type', 'text/css');
5931
5933
let styleTagContents = '';
5932
5934
5933
5935
rules.forEach((rule, i) => {
5939
5941
});
5940
5942
5941
5943
styleTagContents = styleTagContents.concat('{display:none!important;min-height:0!important;height:0!important;}');
5942
- styleTag.innerText = styleTagContents;
5944
+ styleTag.href = 'data:text/css,' + encodeURIComponent( styleTagContents) ;
5943
5945
5944
5946
document.head.appendChild(styleTag);
5945
5947
}
Original file line number Diff line number Diff line change 6016
6016
* @param {string} rules[].type
6017
6017
*/
6018
6018
function injectStyleTag (rules) {
6019
- const styleTag = document.createElement('style');
6019
+ const styleTag = document.createElement('link');
6020
+ styleTag.setAttribute('rel', 'stylesheet');
6021
+ styleTag.setAttribute('type', 'text/css');
6020
6022
let styleTagContents = '';
6021
6023
6022
6024
rules.forEach((rule, i) => {
6028
6030
});
6029
6031
6030
6032
styleTagContents = styleTagContents.concat('{display:none!important;min-height:0!important;height:0!important;}');
6031
- styleTag.innerText = styleTagContents;
6033
+ styleTag.href = 'data:text/css,' + encodeURIComponent( styleTagContents) ;
6032
6034
6033
6035
document.head.appendChild(styleTag);
6034
6036
}
You can’t perform that action at this time.
0 commit comments