Module:MainPageSkinSwitch
Documentation for this module may be created at Module:MainPageSkinSwitch/doc
function p.detectSkin()
local frame = mw.getCurrentFrame()
local request = frame:getRequest()
local cookieData = request:getHeader('Cookie')
local skin = 'vector' -- Default to vector
if cookieData then
for cookie in cookieData:gmatch('([^;]+)') do
local name, value = cookie:match('(%s*)(.+)=(.+)')
if name and name:match('userSkin') then
skin = value
break
end
end
end
mw.log('Detected skin from cookie: ' .. tostring(skin))
return skin
end