Closed myrdd closed 6 years ago
Hi, I have a question regarding those lines in here:
<!-- @if EXTENSION_TYPE='legacy' -->
<script src="chrome://rpcontinued/content/bootstrap/environments/settings.js"></script>
<!-- @endif -->
<!-- @if EXTENSION_TYPE!='legacy' -->
<script src="chrome://rpcontinued/content/settings/main.js"></script>
<!-- @endif -->
I guess that they should be modify to become :
<!-- @if EXTENSION_TYPE='legacy' -->
<script src="chrome://rpcontinued/content/bootstrap/environments/settings.js"></script>
<!-- @endif -->
<!-- @if EXTENSION_TYPE!='legacy' -->
<script src="main.js"></script>
<!-- @endif -->
If legacy, then loads settings.js else loads main.js. Is that right ?
In addition, I don't find main.js in the settings directory. Is that an existing mistake in the current code or I'm missing something ?
Hi @jrrdev I just realized the non-legacy line needs to be:
<script data-main="{JS file name}" src="../lib/third-party/require.min.js"></script>
where {JS file name}
should be e.g. basicprefs.js
, see <html id="{module name}">
in each file.
require.min.js
doesn't exist yet, I'll add it in a future commit. (I've got too many unpublished commits locally ;) )
I updated the PR to load requireJS on setting pages, see commit https://github.com/RequestPolicyContinued/requestpolicy/pull/868/commits/349160583b6b425744ee029068457a64a5dd3442
The URLs in the files in
src/content/settings/
need to be changed:Every link (e.g. here, here and here) …
EXTENSION_TYPE!='legacy'
EXTENSION_TYPE='legacy'
(as it is now)Example:
will become
(PS: This is a quick and dirty solution, I know.)