listChannels and postMessage function