archematics/tools/makePlugin.bash
Glen Whitney b4f732d5bf feat: Get extension working in the Edge browser
To accomplish this, it needed to be bundled up in a zip file, so
  code to do that was added. (Quite possibly the zip will be able to
  be renamed as an .xpi file to create the file needed for Firefox.
  At the moment, you must extract this zip and "sideload" the extension
  into Edge by selected the extracted folder. I read that Edge will
  handle the packing into a single extension file itself.

  Also, some of the features used in the extension had to be polyfilled
  into Edge. And the final major change is that the "Xray" feature is
  not available in Edge, so data passed from the content script to the
  script injected into the page had to be moved from Xray to attributes
  of the script element. This all represents more progress on #28,
  Chrome(ium) is next.
2023-10-09 20:03:36 -07:00

28 lines
1008 B
Bash

# Takes one parameter, the destination directory
mkdir -p $1/deps/x_ite/assets/images
mkdir -p $1/deps/x_ite/assets/components
cp etc/manifest.json etc/options.html $1
cp etc/deps/x_ite/x_ite.css $1/deps/x_ite
cp etc/deps/x_ite/assets/images/logo.128.png $1/deps/x_ite/assets/images
cp etc/deps/x_ite/x_ite.mjs $1/deps/x_ite
cp etc/deps/x_ite/assets/components/* $1/deps/x_ite/assets/components
geoFiles=($(grep deps/GeoGebra etc/manifest.json))
for spec in "${geoFiles[@]}"
do
quotspec=${spec%,}
trimRspec="${quotspec%\"}"
trimspec="${trimRspec#\"}"
dest=${trimspec%/*}
mkdir -p $1/$dest
cp -r etc/$trimspec $1/$dest
done
npx rollup public/js/giveAwrl.js --dir $1
npx rollup public/js/adapptlet.js --file $1/adapptlet.js
npx rollup public/js/adapptext.js --file $1/adapptext.js
cp public/js/options.js public/js/adapptypes.js $1
cp node_modules/webextension-polyfill/dist/browser-polyfill.js $1
cp node_modules/@webcomponents/custom-elements/custom-elements.min.js $1
zip -r $1 $1