模块:Deep2 OutputInj
可在模块:Deep2 OutputInj/doc创建此模块的帮助文档
local p = {}
function p.test()
local frame = mw.getCurrentFrame()
-- Try to output raw HTML
local results = {}
-- Method 1: Return raw HTML tags
results[1] = '<script>/*TEST_SCRIPT*/</script>'
-- Method 2: Try mw.html library
results[2] = tostring(mw.html.create("div"):attr("onclick", "alert(1)") and "div_created" or "div_failed")
-- Method 3: Check if preprocess is available on frame
results[3] = "frame_preprocess=" .. type(frame.preprocess)
results[4] = "frame_extensionTag=" .. type(frame.extensionTag)
results[5] = "frame_callParserFunction=" .. type(frame.callParserFunction)
return table.concat(results, " | ")
end
return p