Skip to content

Commit

Permalink
feat(browser-extension): Raw support now domain specific
Browse files Browse the repository at this point in the history
  • Loading branch information
Darran Boyd committed Nov 29, 2024
1 parent acac698 commit 10af055
Show file tree
Hide file tree
Showing 6 changed files with 140 additions and 193 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
limitations under the License.
******************************************************************************************************************** */

import { ThreatComposerTarget, getExtensionConfig } from './popup/config';
import { getExtensionConfig } from './popup/config';
import { logDebugMessage } from '../debugLogger';


Expand All @@ -23,16 +23,8 @@ export default defineBackground(() => {
browser.runtime.onMessage.addListener(function (request: any, sender: any, sendResponse: any) {

getExtensionConfig().then(config => {
const tcViewer = config.target;
let tcUrl = '';

if (tcViewer == ThreatComposerTarget.BUILT_IN) {
tcUrl = browser.runtime.getURL('');
} else if (tcViewer == ThreatComposerTarget.GITHUB_PAGES) {
tcUrl = 'https://awslabs.github.io/threat-composer';
} else if (tcViewer == ThreatComposerTarget.CUSTOM_HOST) {
tcUrl = config.customUrl ?? '';
}
const tcUrl = browser.runtime.getURL('');

if (request.schema) { //This is likely the JSON from a threat model
logDebugMessage(config, 'Message recieved - Threat Model JSON');
Expand Down
Loading

0 comments on commit 10af055

Please sign in to comment.