在不支持下载图像或在新选项卡中打开它们的页面上,我可以使用 Chrome 开发人员(工具->网络)右键单击图像并执行“将图像复制为 URI”。
是否可以对 puppeteer 做同样的事情?
我尝试使用一些旨在将图像转换为其 base64 表示的 Node.js 模块,但它们似乎都下载图像然后返回 base64 表示。
我正在尝试移植使用visual studio和linux gcc4.6编译好的代码抛出这个:
PieMenu.cpp: In member function ‘void PieMenu::AddButtons()’:
error: no matching function for call to ‘std::basic_ifstream<char>::open(const wchar_t*)’
PieMenu.cpp:110:44: note: candidate is:
/usr/include/c++/4.6/fstream:531:7: note: void std::basic_ifstream<_CharT, _Traits>::open(const char*, std::ios_base::openmode) [with _CharT = char, _Traits = std::char_traits<char>, std::ios_base::openmode = std::_Ios_Openmode]
/usr/include/c++/4.6/fstream:531:7: note: no known conversion for argument 1 from ‘const wchar_t*’ to ‘const char*’
Run Code Online (Sandbox Code Playgroud)
这是.cpp的相关部分:
void PieMenu::AddButtons()
{
CString slash = CUtils::Slash();
CString texturePath,namelistPath=m_pluginPath;
#ifndef linux
texturePath = L".." + slash + L".." + slash; // On windows plugin is located …
Run Code Online (Sandbox Code Playgroud)