File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,15 @@ function prefixPlugin (prefixMessage) {
62
62
}
63
63
}
64
64
65
+ function suffixPlugin ( suffixMessage ) {
66
+ return {
67
+ name : 'suffix-plugin' ,
68
+ renderChunk ( code ) {
69
+ return `${ code } \n${ suffixMessage } `
70
+ }
71
+ }
72
+ }
73
+
65
74
const prefixMessage = '/*! © DuckDuckGo ContentScopeScripts protections https://github.com/duckduckgo/content-scope-scripts/ */'
66
75
67
76
/**
@@ -89,6 +98,7 @@ export async function rollupScript (params) {
89
98
const trackerLookupData = readFileSync ( './build/tracker-lookup.json' , 'utf8' )
90
99
trackerLookup = trackerLookupData
91
100
}
101
+ const suffixMessage = `/*# sourceURL=duckduckgo-privacy-protection.js?scope=${ name } */`
92
102
// The code is using a global, that we define here which means once tree shaken we get a browser specific output.
93
103
const mozProxies = supportsMozProxies
94
104
const plugins = [
@@ -113,6 +123,10 @@ export async function rollupScript (params) {
113
123
prefixPlugin ( prefixMessage )
114
124
]
115
125
126
+ if ( platform === 'firefox' ) {
127
+ plugins . push ( suffixPlugin ( suffixMessage ) )
128
+ }
129
+
116
130
const bundle = await rollup . rollup ( {
117
131
input : scriptPath ,
118
132
plugins
You can’t perform that action at this time.
0 commit comments