File tree Expand file tree Collapse file tree 4 files changed +81
-36
lines changed
Expand file tree Collapse file tree 4 files changed +81
-36
lines changed Original file line number Diff line number Diff line change 44 "description" : " Provides more features to the Hoppscotch webapp (https://hoppscotch.io/)" ,
55 "scripts" : {
66 "clean" : " rimraf dist .parcel-cache" ,
7- "build:chrome" : " HOPP_EXTENSION_TARGET=CHROME parcel build src/* --dist-dir dist/ && copyfiles icons/* dist" ,
8- "build:firefox" : " HOPP_EXTENSION_TARGET=FIREFOX parcel build src/* --dist-dir dist/ && copyfiles icons/* dist"
7+ "build:chrome" : " HOPP_EXTENSION_TARGET=CHROME parcel build src/* --dist-dir dist/ --no-optimize && copyfiles icons/* dist" ,
8+ "build:firefox" : " HOPP_EXTENSION_TARGET=FIREFOX parcel build src/* --dist-dir dist/ --no-optimize && copyfiles icons/* dist"
99 },
1010 "author" : " Andrew Bastin" ,
1111 "license" : " MIT" ,
1212 "devDependencies" : {
1313 "@parcel/config-default" : " ^2.10.0" ,
1414 "@parcel/core" : " ^2.10.0" ,
1515 "@parcel/plugin" : " ^2.10.0" ,
16+ "@parcel/transformer-inline-string" : " 2.10.0" ,
1617 "@parcel/transformer-raw" : " ^2.10.0" ,
1718 "@types/chrome" : " ^0.0.246" ,
1819 "@types/node" : " ^17.0.23" ,
2526 },
2627 "dependencies" : {
2728 "axios" : " ^1.5.1" ,
29+ "lit" : " ^3.1.3" ,
2830 "lit-html" : " ^3.0.0"
2931 }
3032}
Original file line number Diff line number Diff line change 1- const fs = require ( "fs" )
1+ import hookContent from "bundle-text:./hookContent.js"
2+ import hookContentInvalidOrigin from "bundle-text:./hookContentInvalidOrigin.js"
23
34declare global {
45 interface Window {
56 HOPP_CONTENT_SCRIPT_EXECUTED : boolean
67 }
78}
89
9- const hookContent = fs . readFileSync ( __dirname + "/hookContent.js" , {
10- encoding : "utf-8" ,
11- } )
12-
13- const hookContentInvalidOrigin = fs . readFileSync (
14- __dirname + "/hookContentInvalidOrigin.js" ,
15- {
16- encoding : "utf-8" ,
17- }
18- )
19-
2010export type HOOK_MESSAGE = {
2111 type : "execute_hook"
2212 origin_type : "VALID_ORIGIN" | "UNKNOWN_ORIGIN"
Original file line number Diff line number Diff line change 11import { html , render } from "lit-html"
2- import { unsafeSVG } from "lit-html/directives/unsafe-svg"
2+ import { unsafeSVG } from "lit/directives/unsafe-svg"
3+ import ICON_ADD from "bundle-text:./add-icon.svg"
4+ import ICON_DELETE from "bundle-text:./delete-icon.svg"
5+ import ICON_ERROR from "bundle-text:./error-icon.svg"
36
47import { DEFAULT_ORIGIN_LIST } from "./defaultOrigins"
58
69const fs = require ( "fs" )
710
8- const ICON_ADD = fs . readFileSync ( __dirname + "/add-icon.svg" , "utf8" )
9- const ICON_DELETE = fs . readFileSync ( __dirname + "/delete-icon.svg" , "utf8" )
10- const ICON_ERROR = fs . readFileSync ( __dirname + "/error-icon.svg" , "utf8" )
11-
1211let origins : string [ ] = [ ]
1312
1413let inputText = ""
You can’t perform that action at this time.
0 commit comments