Chrome extension submission rejected due to "Purple Copper" Reference

Viewed 18

My submission was immediately rejected and I got this message:

Violation(s):

User Data Privacy - Secure Transmission:

Violation reference ID: Purple Copper Violation: Not handling user data in a secure manner How to rectify: Ensure secure transmission of user data. Relevant section of the program policy: If your Product handles personal or sensitive user data, handle the user data securely. (learn more)

Is this because I am fetching data via remote API on SSL URL? Or something else? I am not fetching any user data, just API calling in background.js

Below is part of background.js

var apiEndPoint = 'http://localhost:8000/'
apiEndPoint = 'http://1.2.3.4/myFolder/'

const API_GET = apiEndPoint+'get.php?url='
const API_READ = apiEndPoint+'read.php?url='

/** Code to Manipulate popup Click Begins */

chrome.action.onClicked.addListener(async function (tab) {
    console.log('Clicked')
    chrome.scripting.executeScript({
      target: { tabId: tab.id },
      func: () => {
        const oldIframe = document.getElementById('cm-frame');
  
        if (oldIframe) {
          oldIframe.remove();
          return;
        }
  
        const iframe = document.createElement('iframe');
        iframe.setAttribute('id', 'cm-frame');
        iframe.setAttribute(
          'style',
          'top: 10px;right: 10px;width: 400px;height: calc(100% - 20px);z-index: 2147483650;border: none; position:fixed;'
        );
        iframe.setAttribute('allow', '');
        iframe.src = chrome.runtime.getURL('index.html');
  
        document.body.appendChild(iframe);
      },
    });
  });

/** Code to Manipulate popup Click Ends */


async function sendReq(url) {
    // console.log('Calling Send Req: '+url)
    let response = await fetch(url)
    let data = ''    
    if (response.status === 200) {
        data = await response.text();        
    }

    return data
}
/**
 * This function will set icon, title etc based on validation status
 * @param {boolean} status 
 */
function setExtensionStatus(status,tabId) {
    var Icon= '16x16'
    var toopTipMessage = 'Agile Super Cluster'
    var badgeText = ''
    
    console.log('Valiation Status')
    console.log(status)
    if(status) {
        Icon = '16x16-green'
        toopTipMessage = 'All Set!'
    } else {
        Icon = '16x16-red'
        // badgeText = 'Error'
        toopTipMessage = 'Oops! Errors occured. Click to view details.'
    }

    chrome.action.setTitle({title: toopTipMessage+'\n'})
    chrome.action.setBadgeBackgroundColor(
        {color: 'black'},  
      );
    chrome.action.setBadgeText(
        {
          text: badgeText,
          tabId: tabId,
        },
      )
    chrome.action.setIcon({
        path : {
        "16": Icon+".png",
        },
        tabId:tabId
    });
}

chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
    console.log('Message got by Background')    
    if(request.from === 'send_url') {
        getInfo(request.msg).then(sendResponse);
    } else if(request.from  === 'set_icon') {
        chrome.tabs.query({active: true}, function(tabs) {
            setExtensionStatus(request.msg,tabs[0].id)
        })        
    }
    
    return true; // keep the channel open for asynchronous sendResponse
});

async function getInfo(url) {
    const res = JSON.parse(await sendReq(`${API_GET}${url}`));
    // const res = await sendReq(`${API_GET}${url}`);
    // console.log(`${API_GET}${url}`)
    // console.log(res)
    //Enable/Disable popup button based on result, saves from unnecessary info
    // on irrelevant site.

    /**
     * NOTE! This block makes extension
     */
    // if(res.status === 'fail') {
    //     chrome.action.disable();
    // } else {
    //     chrome.action.enable();
    // }

    return res.status === 'ok' ? {
      rules: res.msg.rules,
      html: await sendReq(`${API_READ}${url}`),
    } : {};
  }

0 Answers
Related